title: Importing module item of subpackage from another subpackage
body: <p>I have this project structure:  </p>
  
  <pre><code>root_package/
  root_package/packA/
  root_package/packA/__init__.py (empty)
  root_package/packA/moduleA.py
  root_package/packB/__init__.py (empty)
  root_package/packB/moduleB.py
  root_package/rootModule.py
  </code></pre>
  
  <p>In the <code>rootModule.py</code> I have <code>from packA.moduleA import ModuleAClass</code>.<br>
  At the <code>packA.moduleA.py</code> I have this <code>from root_package.packB.moduleB import ModuleBItem</code>.  </p>
  
  <p>When running rootModule either via PyCharm or the terminal with <code>python ./rootModule.py</code> I am getting this error:</p>
  
  <p>Was this the right way of importing?</p>
  
  <pre><code>Traceback (most recent call last):
    File "/project_dir/rootPackage/rootModule.py", line 7, in &lt;module&gt;
      from packA.moduleA import ModuleAClass
    File "/project_dir/rootPackage/packA/moduleA.py", line 8, in &lt;module&gt;
      from rootPackage.packB.moduleB import module_b_method
    File "/project_dir/rootPackage/rootModule.py", line 7, in &lt;module&gt;
      from packA.wavelet_compression import WaveletCompression
  ImportError: cannot import name WaveletCompression
  </code></pre>
  
  <p>How to solve this?</p>
  
  <p><strong>Update 1</strong><br>
  I've added a test file at the <em>project_folder</em> (<strong>not</strong> the root_package folder).<br>
  So the current directory structure is this:  </p>
  
  <pre><code>project_folder/
  project_folder/root_package/
  project_folder/root_package/packA/
  project_folder/root_package/packA/__init__.py (empty)
  project_folder/root_package/packA/moduleA.py
  project_folder/root_package/packB/__init__.py (empty)
  project_folder/root_package/packB/moduleB.py
  project_folder/root_package/rootModule.py
  project_folder/test_rootModule.py
  </code></pre>
  
  <p>I haven't made the <code>project_folder</code> a package (no <code>__init__.py</code> file) since, the <code>test_rootModule</code> is simply a script to help me run the experiments.  </p>
  
  <p>So, in <code>root_package/packA/moduleA.py</code>, after changing the <code>from root_package.packB.moduleB import ModuleBitem</code>, to <code>from packB.moduleB import ModuleBitem</code>, as the answer suggests, it works.  </p>
  
  <p>But now there are <strong>two</strong> problems:<br>
  1. PyCharm doesn't agree with the change:<br>
  <a href="https://i.stack.imgur.com/7D9Zj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7D9Zj.png" alt="pycharm-import-error"></a></p>
  
  <ol start="2">
  <li><p>I cannot run my experiments from the <code>project_folder/test_rootModule.py</code> script. 
  I got this error: </p>
  
  <p>Traceback (most recent call last):<br>
    File "project_folder/test_rootModule.py", line 8, in <br>
      from root_package.rootModule import rootModuleClass<br>
    File "project_folder/root_package/rootModule.py", line 7, in <br>
      from packA.moduleA import ModuleAClass<br>
    File "project_folder/root_package/packA/moduleA.py", line 8, in <br>
      from packB.moduleB import module_b_item<br>
  ImportError: No module named packB.moduleB  </p></li>
  </ol>
  
  <p><em>I cannot seem to get the 2nd Traceback to look like a code segment.</em></p>
  
  <p><strong>Update 2</strong>  </p>
  
  <p>What solved the problem was going to the <code>Project: project_name &gt; Project Structure</code> dialog in PyCharm, selecting the <code>root_package</code> and then setting it as a <code>Sources</code> folder.<br>
  Now, I can run via the IDE both the <code>rootModule</code> and the <code>test_rootModule</code>. </p>
  
  <p><strong>Although</strong>, I cannot get to run the <code>test_rootModule</code> from the terminal. 
  The <code>test_rootModule</code> has these imports:  </p>
  
  <pre><code>from root_package.rootModule import RootModuleClass
  from root_package.packB.moduleB import module_b_item
  </code></pre>
  
  <p>I am at the <code>project_folder</code> dir, and run <code>python ./test_rootModule.py</code> and get this error:  </p>
  
  <pre><code>Traceback (most recent call last):
    File "./test_rootModule.py", line 8, in &lt;module&gt;
      from root_package.rootModule import RootModuleClass
    File "project_folder/root_package/rootModule.py", line 7, in &lt;module&gt;
      from packA.moduleA import ModuleAClass
    File "project_folder/root_package/packA/moduleA.py", line 8, in &lt;module&gt;
      from packB.moduleB import module_b_item
  ImportError: No module named packB.moduleB
  </code></pre>