Repository navigation
Virtual environments not listed with Python: Select Interpreter #1192
Description
This seems to have stopped working in a recent version of either VS Code or the Python extension. I believe it worked about 1 month ago.
Environment data
- VS Code version: 1.21.1
- Extension version (available under the Extensions sidebar): 2018.2.1 (09 Mar 2018)
- OS and version: MacOS High Sierra 10.13.3
- Python version (& distribution if applicable, e.g. Anaconda): 2.7 (system) / 3.6 (Homebrew)
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
- Relevant/affected Python packages and their versions: N/A
Actual behavior
Python: Select Interpreter menu only shows 3 interpreters - /usr/bin/python2.7, /usr/local/bin/python3, /User/kristofferb/.venv/flask-rest-test/bin/python
The flask-rest-test entry is loaded (title is "Python 3.6.4 (venv)"), however this resides under another .venv folder I've previously used (not the one specified in python.venvPath). Why this works, is not clear to me, it might be because I've specified this manually in another project.
Expected behavior
All interpreters under the specified python.venvPath is made available, not just system (and one which is recently used)
Steps to reproduce:
python -m venv ~/.venv2/test_vscode_venvmkdir test_vscode_venv; echo "import this" > test_vscode_venv/test.py; code test_vscode_venv- change User Settings to
{"python.venvPath": "~/.venv2/"} - open Python: Select Interpreter menu - the interpreteres shown are those under Actual behavior
Logs
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
Linter 'pylint' is not installed. Please install it or select another linter".
Error: Module 'pylint' not installed.
Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)
console.ts:136 [Extension Host] Python Extension: Linter 'pylint' is not installed. Please install it or select another linter". Error: Module 'pylint' not installed.
at PythonExecutionService.<anonymous> (/Users/kristofferb/.vscode/extensions/ms-python.python-2018.2.1/out/client/common/process/pythonProcess.js:92:27)
at Generator.next (<anonymous>)
at fulfilled (/Users/kristofferb/.vscode/extensions/ms-python.python-2018.2.1/out/client/common/process/pythonProcess.js:12:58)
at <anonymous>
[...]
console.ts:136 [Extension Host] Python Extension: Linter 'pylint' is not installed. Please install it or select another linter". Error: Module 'pylint' not installed.
at PythonExecutionService.<anonymous> (/Users/kristofferb/.vscode/extensions/ms-python.python-2018.2.1/out/client/common/process/pythonProcess.js:92:27)
at Generator.next (<anonymous>)
at fulfilled (/Users/kristofferb/.vscode/extensions/ms-python.python-2018.2.1/out/client/common/process/pythonProcess.js:12:58)
at <anonymous>
[...]
Activity
kbakk commentedon Mar 26, 2018
Here is the tree structure (limited to three levels):
hruan commentedon Mar 28, 2018
I'm seeing this too. Adding few more details.
python.venvPathis set to${env:HOME}/.venvswhich contains more than one venvPython: Select Interpretercommand shows system wide Python interpreters and just one of the venvsbrettcannon commentedon Apr 3, 2018
I can't reproduce with the development build of the extension:

Is everyone running the latest version of the extension? (I notice Kristoffer Bakkejord (@kbakk) is not for instance.)
hruan commentedon Apr 4, 2018
I'm on version 2018.3.1. Running on VS Code 1.12.1 on OS X 10.13.3.
kbakk commentedon Apr 4, 2018
Have upgraded from 2018.2.1 -> 2018.3.1 since this was reported. Still seeing the issue.
I notice that you use Windows, Brett Cannon (@brettcannon). Could this be limited to MacOS (as both me and Hang Ruan (@hruan) uses)?
cloudyparts commentedon Apr 4, 2018
I had the same issue. I disabled then reenabled the extension and this resolved the issue.
brettcannon commentedon Apr 5, 2018
Kristoffer Bakkejord (@kbakk) it's certainly possible it's mac-only. Could you see if what patrick devlin (@cloudyparts) did somehow fixes it? Otherwise someone on our team who has a Mac will have a look.
gbonline commentedon Apr 9, 2018
I've the same issue, on Mac osx 10.11.6
with virtualenv+wrapper, by setting the python.venvPath,
when I used VScode in October for a project, everything worked as expected: all my venvs were listed
after the VSCode updates, this behavior is broken.
The disable/reload/enable extension process don't solve the issue
DonJayamanne commentedon Apr 9, 2018
Kristoffer Bakkejord (@kbakk) Gbonline (@gbonline) patrick devlin (@cloudyparts) Hang Ruan (@hruan)
Replicated at my end.
DonJayamanne commentedon Apr 10, 2018
Kristoffer Bakkejord (@kbakk) Gbonline (@gbonline) patrick devlin (@cloudyparts) Hang Ruan (@hruan)
Install from VSIXfrom theCommand PaletteLet me know how this goes
Reverted change that ended up considering symlinked interpreters as d…
kbakk commentedon Apr 11, 2018
Don Jayamanne (@DonJayamanne) Installing the provided extension fixed the issue for me! Thank you!
hruan commentedon Apr 11, 2018
Works for me as well.
Will we need reinstall extension from Marketplace once, 2018.4 is released?
DonJayamanne commentedon Apr 11, 2018
No, it's automatic
jorgepinon commentedon Apr 21, 2018
In case anyone still has this issue, I tried the VSIX plugin above but the command palette still wasn't showing my pyenv-installed 3.4.3 version.
However, running this in the command line
pyenv global 3.4.3Made it appear in the Select Interpreter list.