Can't import by library name, even though I have python setup.py develop it
<p>I am running into a very strange python import problem. I wrote my own repo, and used a setup.py script to setup the import path, script below:</p>

<pre><code>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import unicode_literals

from setuptools import setup, find_packages

__author__ = 'Shaun Rong'
__version__ = '0.1'
__maintainer__ = 'Shaun Rong'
__email__ = 'rongzq08@gmail.com'

if __name__ == "__main__":
    setup(name='Quantomic',
          version=__version__,
          author="Ziqin (Shaun) Rong, Wenxuan Huang",
          author_email="rongzq08@mit.edu key01027@mit.edu",
          license="MIT License",
          packages=find_packages(),
          zip_safe=False)
</code></pre>

<p>I used <code>python setup.py develop</code> to run the codes. Now, however, I can't import the whole library by name <strong>Quantomic</strong>, any codes like </p>

<pre><code>import Quantomic
</code></pre>

<p>or </p>

<pre><code>from Quantomic import settings
</code></pre>

<p>will raise the error: <code>ImportError: No module named Quantomic</code></p>

<p>I do have a <code>__init__.py</code> under the library root, and I checked <code>sys.path</code>, <code>/Users/shaunrong/Documents/projects/Quantomic</code> is in the path.</p>

<p>I do, however, can import using relative paths in any codes inside Quantomic, using like</p>

<pre><code>import settings
</code></pre>

<p>will work OK.</p>

<p>Can anyone tell me what is going on? I am happy to provide more information upon request!</p>

<p><strong>UPDATE</strong></p>

<p>File/Folder structure looks like:</p>

<pre><code>/Quantomic
    __init__.py
    settings.py
    /data
        __init__.py
        price.py 
</code></pre>

<p>Your <code>setup.py</code> file is in the wrong directory.  Here is your folder structure</p>

<pre><code>/Quantomic
    setup.py
    __init__.py
    settings.py
    /data
        __init__.py
        price.py 
</code></pre>

<p>It should look like this</p>

<pre><code>/Quantomic (can be named anything)
    setup.py
    /Quantomic
        __init__.py
        settings.py
        /data
            __init__.py
            price.py 
</code></pre>

<p>When you last ran <code>setup.py</code>, it likely installed a <code>data</code> library into your python installation.  Or, because you used <code>develop</code>, it added the path above <code>data</code> to the pythonpath using a <code>pth</code> file in your python libs folder.</p>

python import