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
Dropdown List of Interpreters in Virtual Environments is Jumbled #2223
Extension version (available under the Extensions sidebar): 2018.7.0
OS and version: MacOS 10.13.6
Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.0 (Homebrew/Pipenv)
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): pipenv
Relevant/affected Python packages and their versions: ...
Actual behavior
Selecting "Python: Select Interpreter" from the Command Palette, the list of available virtual environments is jumbled, and includes CLang version information, followed by the type of virtual environment:
Also, in the dropdown list, the type of virtual environment is shown as "(virtualenv)", which is less helpful than the original "(pipenv)". The "pipenv" notation was correctly displayed in the February 2018 Release blog post.
Also, in the status bar, the Python version information does not include the type of virtual environment for the selected interpreter.
Expected behavior
The list items should not include Clang version information.
The status bar should indicate the type of virtual environment after the Python version, to help clarify which interpreter is active.
Steps to reproduce:
Open VSCode in a directory containing a pipenv Pipfile.
Open a Python script file.
From the Command Palette, choose "Python: Select Interpreter" to display the list of virtual environments.
Logs
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
none
Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)
Virtual envs wins over PipEnvs. Solution: Change order of registration of providers in src/client/interpreter/locators/index.ts (move PipEnv locator above VirtualEnvs)
One problem we'll have is differentiating between PipEnv environments and standard virtual envs. According to the documentation pipenv environments are created in the standard directory (see Automatically creates a virtualenv in a standard location.)
Ok. Before switching to Pipenv, I had tried to resolve venv issues by extending python.venvFolders and python.venvPath paths (using the ~/ home directory shortcut), but it didn't work well, and in the end, I commented them out, leaving only the default values in my user settings. So, it was the default settings only that generated the jumbled dropdown list contents.
Now, adding the fully qualified path in both venvFolders and venvPath cleans up the dropdown list display and correctly labels the type of venv in the list.
Edit: Actually, the display of the venv type was correct (pipenv) until I restarted VSCode. Now it's reverted to (virtualenv) again. Getting closer, though.
Activity
DonJayamanne commentedon Jul 22, 2018
I'm able to replicate this as follows:
settings.jsonas follows:This causes the extension to look for virtual envs in the above directories.
Two problems:
src/client/interpreter/locators/index.ts(move PipEnv locator above VirtualEnvs)DonJayamanne commentedon Jul 22, 2018
One problem we'll have is differentiating between PipEnv environments and standard virtual envs. According to the documentation pipenv environments are created in the standard directory (see Automatically creates a virtualenv in a standard location.)
DonJayamanne commentedon Jul 22, 2018
I cannot think of a solution that'll guarantee we'll be able to differentiate between pipenv and standard virtual envs.
Suggestion: Leave the current behavior
@Microsoft/pvsc-team
wlbentley commentedon Jul 23, 2018
Ok. Before switching to Pipenv, I had tried to resolve venv issues by extending
python.venvFoldersandpython.venvPathpaths (using the~/home directory shortcut), but it didn't work well, and in the end, I commented them out, leaving only the default values in my user settings. So, it was the default settings only that generated the jumbled dropdown list contents.Now, adding the fully qualified path in both
venvFoldersandvenvPathcleans up the dropdown list display and correctly labels the type of venv in the list.Edit: Actually, the display of the venv type was correct
(pipenv)until I restarted VSCode. Now it's reverted to(virtualenv)again. Getting closer, though.Thanks.
Ensure workspace `pipenv` environment is not labeled as a `virtual en…