You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Easily Add Folder to PYTHONPATH from VS Code UI #735
Hi, I’m not sure if this belongs here or in vscode-python, but I’d like to request a more user-friendly way to add folders to the Python path in VS Code.
Current Situation
The python.analysis.extraPaths setting only affects IntelliSense, not the runtime PYTHONPATH.
Using a .env file with PYTHONPATH=path1;path2;path3 is unreliable (in my experience) and not user-friendly.
Creating a .pth file in .venv/Lib/site-packages/ as below works, but is also tedious and not user-friendly.
path1/src/
path2/src/
...
Feature Proposal
It would be very helpful to have:
A context menu command when right-clicking a folder (e.g., “Add to Python Path”)
An accessible command in the Command Palette (Ctrl+Shift+P)
A button in the python-environments extension UI (it would be very intuitive to have a small icon/button next to each venv in the list. Clicking this button could prompt the user to select a folder, and then automatically add that folder to the venv using the .pth method.)
This should add the folder to the Python path of the currently selected virtual environment in VS Code.
This would make managing the Python path much easier, especially for users coming from PyCharm, where this is a standard feature.
Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.
If you do this can you please make sure that the PYTHONPATH is always set in all these cases:
a terminal is opened
a vscode task is run
a python script is debugged
a pyhton script is run
a test is run
a test is debugged
.pth method I described and used in my PR is a Python built-in mechanism and should work in all those cases since they're processed during Python interpreter startup.
Activity
github-actions commentedon Aug 21, 2025
Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.
albertino87 commentedon Aug 29, 2025
If you do this can you please make sure that the PYTHONPATH is always set in all these cases:
kipavy commentedon Aug 29, 2025
.pth method I described and used in my PR is a Python built-in mechanism and should work in all those cases since they're processed during Python interpreter startup.
eleanorjboyd commentedon Sep 8, 2025
Thanks everyone for voting here- it past the threshold. I will review the PR and look at the implementation
kipavy commentedon Oct 20, 2025
Hi, any news ? Thanks