question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Look into ways to automatically select environment without specifying `python.pythonPath`

See original GitHub issue

Basically 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:closed
  • Created 5 years ago
  • Reactions:18
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
eirannejadcommented, Apr 27, 2019

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 workspace settings.json. I’d appreciate any help on understanding the issue better. Thanks!

1reaction
brettcannoncommented, Apr 29, 2019

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found