title: Import a file from a subdirectory?
body: <p>I have a file called <code>tester.py</code>, located on <code>/project</code>.</p>
  
  <p><code>/project</code> has a subdirectory called <code>lib</code>, with a file called <code>BoxTime.py</code>:</p>
  
  <pre class="lang-none prettyprint-override"><code>/project/tester.py
  /project/lib/BoxTime.py
  </code></pre>
  
  <p>I want to import <code>BoxTime</code> from <code>tester</code>. I have tried this:</p>
  
  <pre><code>import lib.BoxTime
  </code></pre>
  
  <p>Which resulted:</p>
  
  <pre class="lang-none prettyprint-override"><code>Traceback (most recent call last):
    File "./tester.py", line 3, in &lt;module&gt;
      import lib.BoxTime
  ImportError: No module named lib.BoxTime
  </code></pre>
  
  <p>Any ideas how to import <code>BoxTime</code> from the subdirectory?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>The <code>__init__.py</code> was the problem, but don't forget to refer to <code>BoxTime</code> as <code>lib.BoxTime</code>, or use:</p>
  
  <pre><code>import lib.BoxTime as BT
  ...
  BT.bt_function()
  </code></pre>