title: how to control the import paths in Python?
body: <p>I am new to Python. I am at a company where they built a large system in Python. They use a proprietary system to manage the paths when the system is running, but now I have been asked to build a standalone script that interacts with some of the code in their system. Sadly, my standalone script won't be running under the path-manager they use, so I need to figure out the paths on my own. </p>
  
  <p>So, for instance, I have this line:</p>
  
  <pre><code>from hark.tasks import REPLY_LINE
  </code></pre>
  
  <p>This is actually copied from some of their older code. In this case, the script can find hark, but hark has an <code>__init__.py</code> file, and that is where the problems start. So I get this:</p>
  
  <pre><code>meg/src/python2/hark/hark/__init__.py in &lt;module&gt;()
        5 from flask import jsonify, render_template, request
        6 import jinja2
  ----&gt; 7 import logbook, logbook.compat
        8 
        9 from healthhark.context import Ghost, g
  </code></pre>
  
  <p>The project that they built actually includes logbook 3 times. If I do:</p>
  
  <pre><code>find . -name "*logbook*"
  </code></pre>
  
  <p>I see: </p>
  
  <pre><code>meg/zurge/opt/python2.7/lib/python2.7/site-packages/logbook
  meg/zurge/opt/python2.7-hark/lib/python2.7/site-packages/logbook
  meg/zurge/opt/python3.4/lib/python3.4/site-packages/logbook
  </code></pre>
  
  <p>Like I said, they have a proprietary path manager that usually tells each piece of code where it can find the packages that it should include, but I am building a standalone app. </p>
  
  <p>I don't know much about Python, but I am wondering if their is an idiomatic and Pythonic way of including packages that are in such distant directories? </p>
  
  <p>And, before anyone suggests <code>pip install</code>, we don't rely on global installs at all. </p>