ImportError: cannot import module - Only one module can not be imported from package
<p>I created a package, for the ease of use I call it packageA.</p>

<p>In this package I have 4 submodules in (separate files) and an init file, so the package contains the following files:</p>

<ul>
<li><code>__init__.py</code></li>
<li>moduleA.py</li>
<li>moduleB.py</li>
<li>moduleC.py</li>
<li>moduleD.py</li>
</ul>

<p>Module B-D stand alone, they don't import any other local module. Module A imports module B-D. </p>

<p>Now I have a script that wants to import <code>packageA</code>, the init.py is empty so far.</p>

<pre><code>import packageA
</code></pre>

<p>works without problems. But moduleA is not available from this import. If I want to use it via packageA.moduleA it raises this error:</p>

<pre><code>AttributeError: 'module' object has no attribute
</code></pre>

<p>The following also works without problems:</p>

<pre><code>from packageA import moduleB
from packageA import moduleC
from packageA import moduleD
</code></pre>

<p>And the next import causes the ImportError:</p>

<pre><code>from packageA import moduleA
</code></pre>

<p>raises this Error:</p>

<pre><code>Traceback (most recent call last):
File "run.py", line 19, in &lt;module&gt;
from packageA import moduleA
ImportError: cannot import name moduleA
</code></pre>

<p>I thought that maybe I'm doing sth wrong in moduleA, but even if moduleA is empty the import raises the same error. It seems like that this module can't be imported somehow. How is this possible?</p>

<p>I have separete unit test files for all python modules, and yes, moduleA is working correctly without any errors.</p>
