title: Python: importing a module that imports a module
body: <p>So in a file foo I am importing modules:</p>
  
  <pre><code>import lib.helper_functions
  import lib.config
  </code></pre>
  
  <p>And in helper_functions.py, I have:</p>
  
  <pre><code>import config
  </code></pre>
  
  <p>When I run the main function of foo I get an ImportError</p>
  
  <p>EDIT: Here is the structure of the files I have</p>
  
  <pre><code>foo.py
  lib/
      config.py
      helper_functions.py
  </code></pre>
  
  <p>The error results from importing config in helper_functions  </p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Python33\foo.py", line 1, in &lt;module&gt;
      import lib.helper_functions
    File "C:\Python33\lib\helper_functions.py", line 1, in &lt;module&gt;
      import config
  ImportError: No module named 'config'
  </code></pre>
  
  <p>So: when I run foo.py the interpreter is complaining about the import statements of helper_functions. Yet when I run the main of helper_functions, no such error appears.</p>