title: Package import works in Python Interactive window (in VSCode) but not in terminal-run python?
body: <p>I have a custom Python package (<code>my_package</code>) located in a directory (<code>super_dir</code>). I have a script (<code>my_script.py</code>) in a nested directory of <code>super_dir</code> (let's call it <code>sub_dir</code>) that imports <code>my_package</code> and uses it.</p>
  
  <p>I receive a <code>ModuleNotFound</code> error if I run the script from a terminal window (where my working directory is <code>super_dir</code>) by calling <code>python sub_dir/my_script.py.</code> It <em>does</em> work, however, if <code>my_script.py</code> is located within <code>super_dir</code>, rather than within <code>sub_dir</code> and I simply call <code>python my_script.py</code>. It also works if I run <code>my_script.py</code> in VSCode in the Python Interactive window (even if I'm my working directory is <code>sub_dir</code>)  as long as I have the lines</p>
  
  <pre><code>import os
  os.chdir('....further_paths/super_dir/') 
  </code></pre>
  
  <p>at the top of the script. </p>
  
  <p>My question is: how can I get the script to run <em>from the terminal</em> such that it can remain within <code>sub_dir</code> but will still be able to import <code>my_package</code>, even though <code>my_package</code> is located 'up' a whole directory? </p>
  
  <p>Even if the lines^ above (that change the current directory) are included at the top of the script, I still get the <code>ModuleNotFound</code> error as long as I run the script from a terminal window and <code>my_script.py</code> is not located in <code>super_dir</code>.</p>
  
  <p>Thank you in advance, I hope my question was clear!</p>