title: importing a package from within another package in python
body: <p>Please assume the following project structure:</p>
  
  <pre><code>/project
    /packages
      /files
        __init__.py
        fileChecker.py
      /hasher
        __init__.py
        fileHash.py
      mainProject.py
      /test
  </code></pre>
  
  <p>I would like to get access to the module fileChecker.py from within the module fileHash.py.
  This is some kind of global package.</p>
  
  <p>One way is to append paths to sys.path.
  [Is this PYTHONPATH by the way?]</p>
  
  <p>What would be a solution when distributing the project? </p>
  
  <ul>
  <li>Same as above? --> But then there could be paths to modules with the
  same name in PYTHONPATH? </li>
  <li>Is setuptools doing all the work?</li>
  </ul>
  
  <p>How can I achieve it in a nice and clean way?</p>
  
  <p>Thanks alot.</p>
  
  <hr>
  
  <p><strong>Update:</strong></p>
  
  <p><em>Also see my answer below</em> 
  --> when calling fileHash.py (including an import like from files import fileChecker) directly from within its package directory, the project's path needs to be added to sys.path (<strong>described below</strong>).</p>
  
  <p><strong>Test cases</strong> situated within /test (see structure above) also need the path added to sys.path, when called from within /test.</p>