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
Originally posted by mrgrieves4 July 11, 2021
As a PyCharm user looking at vscode, one thing that I find pretty unintuitive and awkward is how the pythonpath is setup in vscode. IE having to create a magic file called .env and place a single PYTHONPATH listing all the folders, and there could be a lot of them.
In PyCharm I just need to right click folders and mark/unmark as sources root, and I can also view a list and edit them from there. (Similarly I can exclude folders like this too)
Preferably the config file should use relative paths and be sharable in a team.
Ideally if I rename a folder it would also update the config.
The other thing I found a little confusing is that "pythonpath" in settings etc seems to refer to an interpreter path rather than the actual pythonpath env var, which is what I was expecting it to mean.
Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 5 👍 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.
Only three days left...
I think it’s not that users don’t need it...but few people know to give feedback here.
there are many different tutorials or posts about how to set PYTHONPATH when using vscode, but all of them are too complicated
abcdehc it's actually 52 days left; we are not starting the clock from the Discussion but from we converted it to an issue.
And we purposefully only want people upvoting who bothered to come to the repo to find a feature and found the corresponding issue. Otherwise we will have to raise the vote threshold even higher to prevent gaming the votes.
For vinclei, AFAIK, there are a few ways, depending on whether you are modifying your global settings, or working per workspace. You may need add your paths in THREE places. This allows them to be added for terminal python, for the python interactive window, and for the pylance code diagnostics tool.
Someone else can chime in if these examples aren't complete or are out of date.
"terminal.integrated.env.windows": {
"PYTHONPATH": "<YOUR PATHS; REMEMBER TO USE DOUBLE // ON WINDOWS>"
},
"jupyter.runStartupCommands": [
// Insert list of directories just after cwd, as if it were prepended to PYTHONPATH
"import os, sys",
"sys.path.insert(1, os.path.join(<YOUR PATH>)"
],
"python.analysis.extraPaths": [<THESE MUST BE RELATIVE PATHS TO YOUR WORKSPACE ROOT>],
Thank you for submitting your feature request and everyone who considered it! Unfortunately this issue did not receive enough votes over the allotted time, and so we are closing the issue.
Activity
brettcannon commentedon Sep 1, 2021
Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 5 👍 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.
abcdehc commentedon Sep 8, 2021
Only three days left...
I think it’s not that users don’t need it...but few people know to give feedback here.
there are many different tutorials or posts about how to set PYTHONPATH when using vscode, but all of them are too complicated
brettcannon commentedon Sep 8, 2021
abcdehc it's actually 52 days left; we are not starting the clock from the Discussion but from we converted it to an issue.
And we purposefully only want people upvoting who bothered to come to the repo to find a feature and found the corresponding issue. Otherwise we will have to raise the vote threshold even higher to prevent gaming the votes.
vinclei commentedon Sep 18, 2021
Upvoted. So what's the proper way of adding PYTHONPATH at this moment? Went through some threads and haven't found a clean way..
ryan-feeley commentedon Sep 19, 2021
For vinclei, AFAIK, there are a few ways, depending on whether you are modifying your global settings, or working per workspace. You may need add your paths in THREE places. This allows them to be added for terminal python, for the python interactive window, and for the pylance code diagnostics tool.
Someone else can chime in if these examples aren't complete or are out of date.
brettcannon commentedon Nov 1, 2021
Thank you for submitting your feature request and everyone who considered it! Unfortunately this issue did not receive enough votes over the allotted time, and so we are closing the issue.