title: ImportError: No module named utils
body: <p>I'm trying to import a utilities file but running into a weird error only when I run the code through a script. </p>
  
  <p>When I run test.py</p>
  
  <p>location: /home/amourav/Python/proj/test.py</p>
  
  <p>code:</p>
  
  <pre><code>import os
  os.chdir(r'/home/amourav/Python/')
  print os.listdir(os.getcwd())
  print os.getcwd()
  from UTILS import *
  </code></pre>
  
  <p>The output is:</p>
  
  <blockquote>
    <p>['UTILS_local.py','UTILS.py',  'proj', 'UTILS.pyc']</p>
    
    <p>/home/amourav/Python</p>
    
    <p>Traceback (most recent call last):
      File "UNET_2D_AUG17.py", line 11, in 
        from UTILS import *
    ImportError: No module named UTILS</p>
  </blockquote>
  
  <p>but when I run the code through the bash terminal, it seems to work fine</p>
  
  <pre><code>bash-4.1$ python
  &gt;&gt;&gt; import os
  &gt;&gt;&gt; os.chdir(r'/home/amourav/Python/')
  &gt;&gt;&gt; print os.listdir(os.getcwd())
  </code></pre>
  
  <blockquote>
    <p>['UTILS_local.py','UTILS.py',  'proj', 'UTILS.pyc']</p>
  </blockquote>
  
  <pre><code>&gt;&gt;&gt; from UTILS import *
  </code></pre>
  
  <blockquote>
    <p>blah blah -everything is fine- blah blah</p>
  </blockquote>
  
  <p>I'm running Python 2.7.10 on a linux machine</p>