title: In Python, cannot import current modules after adding the importing root path
body: <p>I have a project below.</p>
  <pre><code>project/
  ├ main/
    ├ modules/
      ├ moduleA.py
  ├ test/
    ├ testA.py
    ├ modules/
      ├ moduleC.py
  </code></pre>
  <p>I programed <code>moduleA.py</code> and <code>moduleC.py</code> below.</p>
  <pre><code># moduleA.py
  def funcA():
    print(&quot;A&quot;)
  </code></pre>
  <pre><code># moduleC.py
  def funcC():
    print(&quot;C&quot;)
  </code></pre>
  <p>In the situation that I want to test <code>moduleA.funcA()</code> with <code>moduleC.funcC()</code> in <code>testA.py</code>, I'm worried about the code importing <code>moduleC.funcC()</code> to <code>testA.py</code>.</p>
  <pre><code>import inspect
  import os
  import sys
  PYPATH = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) + &quot;/&quot;
  sys.path.append(PYPATH + &quot;./../&quot;)
  from main.modules.moduleA import funcA # This is OK.
  
  # from test.modules.moduleC import funcC # ModuleNotFoundError
  from modules.moduleC import funcC # This is OK.
  
  if __name__ == &quot;__main__&quot;:
    funcA()
    funcC()
  </code></pre>
  <p>I want to import <code>funcC()</code> to <code>testA.py</code> with <code>from test.modules.moduleC import funcC</code>.</p>
  <p>Would you say this is feasible?</p>