Detect virutal envs recursively in all sub-directories in the workspace
See original GitHub issueThis issue is similar to #2470 but the solution doesn’t apply to me. I tried changing the “python.venvPath”: “${workspaceFolder}/venv” in setting.json but it didn’t help. As it can be seen in the screenshot, I can use the virtual environment using terminal.
Environment data
- VS Code version: 1.45.1
- Extension version (available under the Extensions sidebar): 2020.5.80290
- OS and version: ubuntu 18.04 (Linux x64 4.15.0-101-generic)
- Python version (& distribution if applicable, e.g. Anaconda): python 3.6.9
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): venv
- Relevant/affected Python packages and their versions: XXX
- Relevant/affected Python-related VS Code extensions and their versions: XXX
- Jedi or Language Server? (i.e. what is
"python.jediEnabled"
set to; more info #3977): true - Value of the
python.languageServer
setting: “Microsoft”
Expected behaviour
Clicking on the interpretor on the left bottom should show all available interpretors including virtual environments.
Actual behaviour
virtual environment are not detected.
Steps to reproduce:
- click on the interpretor selection on the left bottom
Logs
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Python Virtual Environments: A Primer
In this tutorial, you'll learn how to work with Python's venv module to create and manage separate virtual environments for your Python ...
Read more >Copy file recursively to all deepest subdirectories
Solution: On the directory containing bar , find . -type d -links 2 -exec cp bar {} \;. Your original attempt find ....
Read more >How to Search for Files Recursively into Subdirectories
You can do it with find only: find . -name '*.xml' . is the current directory. If you need to search in another...
Read more >gitignore syntax - how to exclude virtualenv sub-directories?
This will ignore all sub directories in the venv folder. ... Pycharm for example asks where you want to set up a virtual...
Read more >Using Python environments in VS Code
When you install into a virtual environment, any packages you install are installed only in that subfolder. When you then run a Python...
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 FreeTop 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
Top GitHub Comments
@PooyaJln With
python.venvPath
we only look in the immediate sub-directories. So if the venv folder is two levels down we will not automatically detect it. This would be an enhancement to how we detect virtual envs in the workspace.Thanks for bringing this up, folks! I opened https://github.com/microsoft/vscode-docs/issues/3789 so we can update our docs to reflect that 😊
@yuvadm our plan is to deprecate the pythonPath setting, so you’ll still be able to select interpreters per workspace but that info won’t be stored in the settings.json file. We have this change on as an experiment, you can learn more about it here: https://github.com/microsoft/vscode-python/wiki/AB-Experiments#experiment---deprecatepythonpath