title: How to import from local python packages in VS Code?
body: <p>My project structure is something like this:</p>
  
  <pre><code>- my_pkg
      setup.py
      README.md
      - my_pkg
          __init__.py
          __main__.py
           - src
               app.py
               part.py
               __init__.py
           - tests
               test_app.py
               test_parts.py
               __init__.py
  </code></pre>
  
  <p>In test_app.py I have the following import statement:</p>
  
  <pre><code>import my_pkg.src.app as app
  </code></pre>
  
  <p>In my terminal I can run the file using </p>
  
  <pre><code>python -m my_pkg.tests.test_app
  </code></pre>
  
  <p>This runs fine without any errors, but when I right click on test_app.py and choose "Run Python File in Terminal" I get the following error:</p>
  
  <pre><code>ModuleNotFoundError: No module named 'my_pkg'
  </code></pre>
  
  <p>I have installed my_pkg by running:</p>
  
  <pre><code>pip install -e .
  </code></pre>
  
  <p>If I open up a terminal and run python and in python run "import my_pkg.src.app as app" it works fine. </p>
  
  <p>What am I doing wrong. How can I get my imports to work when running my program in visual studio code?</p>