title: Import python files from other directory without sys.path.append or changing PATH
body: <p>I have the following folder structure</p>
  
  <pre><code>project
    +folder src
      +file main.py
      +file __init__.py
    +folder tests
      +file test.py
      +file __init__.py
    +file __init__.py
  </code></pre>
  
  <p>All <code>__init__</code> files are empty.</p>
  
  <p>Now I want to be able to run <code>test.py</code> form <strong>anywhere</strong>, this is important.</p>
  
  <p><code>test.py</code> calls</p>
  
  <pre><code>import src
  </code></pre>
  
  <p>because it needs functions from <code>main.py</code>.
  This leads to an error:</p>
  
  <pre><code>ImportError: no module named src
  </code></pre>
  
  <p>Solutions I found include adding a <code>sys.path.append</code> command to <code>test.py</code> or adding the folder src to my <code>PATH</code> environment variable - is there no other way?</p>
  
  <p>I cannot force every user to change their <code>PATH</code> and I cannot add <code>sys.path.append</code> commands to all test files.</p>