title: Python Import Error (ModuleNotFoundError) when importing a function from a module that imports a class from another module
body: <p>My file structure looks like: </p>
  
  <pre><code>/dir/
      main.py
      /src/
          functionsfile.py
          classfile.py
  </code></pre>
  
  <p>The <code>functionsfile</code> has a function that uses the class created in the <code>classfile</code>. I import that class with </p>
  
  <pre><code>from classfile import ClassName
  </code></pre>
  
  <p>(I've also tried importing <code>*</code>).</p>
  
  <p>Just testing the function in the <code>functionsfile</code> with a <code>print</code> statement, it appears to find the class module and use the <code>ClassName</code> just fine, but then when I <code>import</code> that function from <code>functionsfile</code> into the <code>main.py</code> script, it gives me the error:</p>
  
  <pre><code>ModuleNotFoundError: No module named 'classfile'
  </code></pre>
  
  <p>I tried importing the function with both: </p>
  
  <pre><code>from functionsfile import function
  </code></pre>
  
  <p>and</p>
  
  <pre><code>from functionsfile import *
  </code></pre>
  
  <p>I'm at a loss for why this is happening?</p>