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
Unable to select virtual environment not located at root #1019
Extension version (available under the Extensions sidebar): 2018.2.1
OS and version: Windows 10 64 Bit
Python version: 2.7 and 3.6
Type of virtual environment used (if applicable): venv
Relevant/affected Python packages and their versions: N/A
Actual behavior
Selecting python executable to run in the lower left hand corner only displays options for the default installed python libraries and virtual environments found at workspace root.
Expected behavior
Extension should either be able to search within the directory tree for virtual environments contained within folders (for example, I have a venv folder located at .\partner-api\venv), or users should be able to type in a full path to a python executable and have this added to the list.
Steps to reproduce:
Add folder to workspace
Add virtual environment root folder to created folder
We look for environments in a specific set of directories.
For instance we do look for environments in the workspace, but only directly in the current workspace, i.e. not 2-3 levels deep. Doing so, is not practical as we'd end up crawling the entire directory structure (imaging a user opening the root directory in VS Code).
The solution in such an instance is for you to use the setting venvPath as follows:
"python.venvPath": "folder path you'd like the extension to look for environments in"
This works if I put a specific directory in, but not with wild characters.
What worked: ${workspaceFolder}\\partner-api
What I would like to work: ${workspaceFolder}\\*
Thank you for the quick reply and solution :) the above method will work, but if I move to having more than one of these setups, I would like to not have to edit this each time (first world problems, I know)
microsoft/vscode-docs#1568 is about documenting python.venvPath better. But as of right now the wildcard directory traversal hasn't seen enough demand to warrant trying to support it (if others come and vote for this then do leave a comment and we will consider re-opening).
Activity
DonJayamanne commentedon Mar 10, 2018
We look for environments in a specific set of directories.
For instance we do look for environments in the workspace, but only directly in the current workspace, i.e. not 2-3 levels deep. Doing so, is not practical as we'd end up crawling the entire directory structure (imaging a user opening the root directory in VS Code).
The solution in such an instance is for you to use the setting
venvPathas follows:DonJayamanne commentedon Mar 10, 2018
Oops, please confirm this works for you.
jtdavis777 commentedon Mar 10, 2018
This works if I put a specific directory in, but not with wild characters.
What worked:
${workspaceFolder}\\partner-apiWhat I would like to work:
${workspaceFolder}\\*Thank you for the quick reply and solution :) the above method will work, but if I move to having more than one of these setups, I would like to not have to edit this each time (first world problems, I know)
brettcannon commentedon Apr 18, 2018
microsoft/vscode-docs#1568 is about documenting
python.venvPathbetter. But as of right now the wildcard directory traversal hasn't seen enough demand to warrant trying to support it (if others come and vote for this then do leave a comment and we will consider re-opening).