title: Calling a Python function from another file
body: <p>This problem has confused me for days.</p>
  
  <p>I have two files, <code>helpers.py</code> and <code>launcher.py</code>.</p>
  
  <p>In <code>helpers.py</code> I have defined the function <code>hello()</code>, which prints "hello".</p>
  
  <p>I want to call <code>hello()</code> in <code>launcher.py.</code></p>
  
  <p>This is what I wrote in <code>launcher.py</code>:</p>
  
  <pre><code>from helpers import hello
  ....
  helpers.hello()
  </code></pre>
  
  <p>But when I run it, I get this:</p>
  
  <pre><code>    from helpers import hello
  ImportError: No module named helpers
  </code></pre>
  
  <p>How do I fix this?</p>
  
  <h3>Edit in response to answers / comments</h3>
  
  <ol>
  <li>I'm using OS X and Python 3.4</li>
  <li>The two files are in the same directory</li>
  <li><p>I tried the two ways:</p>
  
  <pre><code>from helpers import hello
  hello()
  </code></pre>
  
  <p>and</p>
  
  <pre><code>import helpers
  helpers.hello()
  </code></pre>
  
  <p>But still this bug:</p>
  
  <pre><code>import helpers
  ImportError: No module named 'helpers'
  </code></pre></li>
  </ol>
  
  <p>I think there should be something wrong in the CLASSPATH of Terminal.</p>
  
  <h3>Second edit</h3>
  
  <p>The problem highlighted in <a href="https://stackoverflow.com/a/32058906/838992">these</a> <a href="https://stackoverflow.com/a/32058881/838992">answers</a> was an issue, but in the end <a href="https://stackoverflow.com/a/32060372/838992">resetting the classpath</a> resolved.</p>