title: Adding to PYTHONPATH in VS Code
body: <p>I'm trying to add the src folder to my <code>PYTHONPATH</code> i.E. do the same thing as <code>Mark directory as sources root</code> in PyCharm.</p>
  
  <p>I've looked at the solutions to <a href="https://stackoverflow.com/questions/41471578/visual-studio-code-how-to-add-multiple-paths-to-python-path">Visual Studio Code - How to add multiple paths to python path?</a> but the solutions shown there do not work for me.</p>
  
  <p>I've set up my minimal example as follows shown in the screenshot below:</p>
  
  <p><a href="https://i.stack.imgur.com/zlflj.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zlflj.png" alt="enter image description here"></a></p>
  
  <p>My understanding would be that having a .env file with <code>PYTHONPATH="./src;${PYTHONPATH}"</code> would add the src file to the path.</p>
  
  <p>Nevertheless, when running the code runner or when running <code>python change_pyhton_path.py</code> src is not part of the PYTHONPATH and the direct import from src fails.</p>
  
  <p>I do have setting <code>"python.envFile": "${workspaceFolder}/.env"</code>.</p>
  
  <p>In pyCharm on the other hand everything works as it should after hitting <code>Mark directory as source</code> on src.
  <a href="https://i.stack.imgur.com/vmOhL.png" rel="noreferrer"><img src="https://i.stack.imgur.com/vmOhL.png" alt="enter image description here"></a></p>
  
  <p>Thanks for helping out!</p>