module has no attribute
<p>I have a directory with a number of <code>.py</code> files in it. each file defines some  classes. I also have an empty <code>__init__.py</code> in the directory.</p>

<p>For example:</p>

<pre><code>
myproject
    __init__.py
    mymodule
        __init__.py
        api.py
        models.py
        views.py
</code></pre>

<p>I am trying to import <code>mymodule</code> and access the classes defined in all these files:</p>

<pre><code>
from myproject import mymodule

print mymodule.api.MyClass 
</code></pre>

<p>It gives me an error saying that <code>mymodule</code> has no attribute <code>api</code>. why? and what I do not understand also is why I can access just one of the files (models.py) and not the others:</p>

<pre><code>
In [2]: dir(banners)
Out[2]:
['__builtins__',
 '__doc__',
 '__file__',
 '__name__',
 '__package__',
 '__path__',
 'models']
</code></pre>
