Look into ways to automatically select environment without specifying `python.pythonPath`
See original GitHub issueBasically VS Code’s design of having only global and workspace settings means there is no concept of a machine-specific setting when teams standardize on a workspace settings.json
. That means we should look at ways to let people either specify the exact way they want their environment to be selected without specifying an absolute path or scale back when we write python.pythonPath
to settings.json
.
One key thing to keep in mind is that environment discovery can be expensive, so we may need to come up with a solution where people can say, e.g. python.usePipenv
or something so we know to short-circuit searching in other ways and only use pipenv
.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:18
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Using Python environments in VS Code
To select a specific environment, use the Python: Select Interpreter command from the Command Palette (Ctrl+Shift+P). Note: If the Python extension doesn't ...
Read more >How can I set up a virtual environment for Python in Visual ...
To select a specific environment, use the Python: Select Interpreter command from the Command Palette (Ctrl+Shift+P). And: The Status Bar always ...
Read more >venv — Creation of virtual environments — Python 3.11.1 ...
Running this command creates the target directory (creating any parent directories that don't exist already) and places a pyvenv.cfg file in it with...
Read more >Manage Python environments and interpreters - Visual Studio ...
Select Add Environment... in the Python Environments window (or from the Python toolbar), which opens the Add environment dialog box. · In the ......
Read more >Using PYTHONPATH — Functional MRI methods
PYTHONPATH is an environment variable. See the Python 3 docs for PYTHONPATH. The PYTHONPATH variable has a value that is a string with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you all for the feedback on this. I’m not fully understanding the challenges behind this but it seems like in most cases, a python project has a venv associated with it so in most cases VSC can just ask the venv manager e.g.
pipenv --venv
for the python path. In all other cases it can ask the user for the project python path. In either case, the path should not be saved in workspacesettings.json
. I’d appreciate any help on understanding the issue better. Thanks!@eirannejad not everyone uses a environment management tool, so there’s subtly there. Otherwise explaining is premature as we have not taken the time to write out our own design for the solution yet.