title: Python Importing Module Error, "Import Error: cannot import name X"
body: <p>I have two python modules, one named testingDirectories.py and another named testFile.py</p>
  
  <p>There are two folders in my directory: simulations and src</p>
  
  <p>"simulations" is supposed to hold all the source code for individual simulations that are being run. </p>
  
  <p>"src" holds the source code for the main project that I run the simulations on.</p>
  
  <p>My testingDirectories.py file is in "simulations", while testFile.py is in "src".</p>
  
  <p>The contents of testFile.py are as follows:</p>
  
  <pre><code>def testFunction(m):
      return 'hello, world'
  </code></pre>
  
  <p>The contents of testingDirectories.py are as follows:</p>
  
  <pre><code>import sys
  import os
  
  from src.testFile import testFunction
  
  testFunction('hello')
  </code></pre>
  
  <p>When I run the simple demo, it gives me an error:</p>
  
  <pre><code>from src.testFile import testFunction
  ImportError: cannot import name testFunction
  </code></pre>
  
  <p>The point of this demonstration is to figure out if the program can find the directory "src" without telling it to look in the root directory. It seems to be able to find other folders and their modules and functions, but not a simple test function like this one. Any ideas why I might be getting this error?</p>