Repository navigation
Select interpreter popup does not shown any system, pyenv or virtualenv choice. #15439
Description
Environment data
- VS Code version: 1.53.2
- Extension version (available under the Extensions sidebar): v2021.2.576481509
- OS and version: OSX Catalina 10.15.7
- Python version (& distribution if applicable, e.g. Anaconda): 3.8.7
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): virtualenv
- Relevant/affected Python packages and their versions: XXX
- Relevant/affected Python-related VS Code extensions and their versions: XXX
- Value of the
python.languageServersetting: Microsoft
[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (python.languageServer: 'Microsoft'), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]
Expected behaviour
When click on select interpreter, the popup should shown all installed python interpreter including system, brew, pyenv and also virtualenv created under pyenv.
Actual behaviour
The select interpreter popup only shown the one interpreter under "/usr/bin/python3", no other interpreters shown like it use to be. However if manually select the desired interpreter/virtualenv through the system dialog box, everything else in python development seems to work just fine.
The extension output the following in the output window complaining of not able to resolve symbolic link, even though all those symbolic link are valid and create by default installation methods include system, brew or pyenv.
Error 2021-02-17 22:56:52: Failed to resolve symbolic link: [Error: ENOENT: no such file or directory, lstat '../../System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7'] {
errno: -2,
code: 'ENOENT',
syscall: 'lstat',
path: '../../System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7'
}
Error 2021-02-17 22:56:52: Failed to resolve symbolic link: [Error: ENOENT: no such file or directory, lstat '../Cellar/python@3.9/3.9.1_8/bin/python3'] {
errno: -2,
code: 'ENOENT',
syscall: 'lstat',
path: '../Cellar/python@3.9/3.9.1_8/bin/python3'
}
Error 2021-02-17 22:56:52: Failed to resolve symbolic link: [Error: ENOENT: no such file or directory, lstat '../Cellar/python@3.9/3.9.1_8/bin/python3.9'] {
errno: -2,
code: 'ENOENT',
syscall: 'lstat',
path: '../Cellar/python@3.9/3.9.1_8/bin/python3.9'
}
BTW, I tested the same setup on linux or windows, it works fine.
Activity
InterelaySolutions commentedon Feb 18, 2021
Can also confirm this is happening to us. Rolling back to the previous version of the python extension fixes it for now.
danieldorosz commentedon Feb 18, 2021
+1. Have rolled back for now.
marhoy commentedon Feb 18, 2021
+1 For me as well. The "Python: Select Interpreter" dialog does not list any of the pyenv virtualenv environments.
Downgrading to version v2021.1.502429796 solves the problem.
karthiknadig commentedon Feb 18, 2021
Have you manually opted into experiments? Check for this setting
"python.experiments.optInto" = ["All"]. We have a new discovery mechanism, and it might be failing. You can opt into specific experiments if you need that. If you are NOT opted in any experiment let us know, there might be some interference going on with the new discovery module and the old one.danieldorosz commentedon Feb 18, 2021
karthiknadig commentedon Feb 18, 2021
@braineruption Can you try this and see if it helps?
"python.experiments.optInto": ["pythonDiscoveryModule"]albireox commentedon Feb 18, 2021
I don't see any difference between having
or not.
karthiknadig commentedon Feb 18, 2021
José Sánchez-Gallego (@albireox) Can you share the paths to the interpreters that it is failing to detect? Also, can you share
PYENVspecific environment variable values?albireox commentedon Feb 18, 2021
It seems to be failing to detect all the pyenv virtualenvs from installations that are not conda. Apparently it finds the pyenv installations and venvs from conda:
but not others such as
~/.pyenv/versions/3.9.1/bin/python~/.pyenv/versions/flicamera/bin/python. These are my pyenv versions:And the environment variables
My system also has Python installations from homebrew, but I don't use them for development.
11 remaining items
robsgreen commentedon Feb 19, 2021
I'm having the same issue. It seems that the discovery mechanism isn't able to follow symlinks any more.
A workaround that I've found is to use "Enter Interpreter Path..." and enter the full path to the env's binary without going through the symlink. For example, to use the venv
my-env:In the "Enter Interpreter Path..." input, use:
~/.pyenv/versions/3.8.6/envs/my-env/bin/pythonalbireox commentedon Feb 19, 2021
This seems fixed to me in the latest
vscode-pythoninsiders either with"python.experiments.optInto": ["pythonDiscoveryModule"]or without it, although I'm seeing some differences in the names of the venvs depending on whether the experiment is on or not.karthiknadig commentedon Feb 19, 2021
We just pushed a point release with a fix for this. Please try and let us know.
albireox commentedon Feb 19, 2021
Point release also works for me.
erongd commentedon Feb 19, 2021
Point release also works for me too.
robsgreen commentedon Feb 19, 2021
Works for me, thanks!
karrtikr commentedon Feb 19, 2021
Glad it worked, closing this now. If it still happens let us know and we'll reopen the issue.
LeoAzLiu commentedon Feb 20, 2021
Do not work for me. 😢
I use pyenv-win on window 10. The "pyenv" function never worked for me but the version v2021.2.576481509. I was exciting when I found it worked. Now it gone again. Is anything I need to config with my scene(pyenv-win)? Thanks!
danieldorosz commentedon Feb 20, 2021
Yup, worked for me too. Thanks for the quick turnaround.
karthiknadig commentedon Feb 20, 2021
laz (@LeoAzLiu)
pyenv-winis detected in the new experimental version of the discovery code. You can get that by opting into it, ad this to your user settings:LeoAzLiu commentedon Feb 21, 2021
Karthik Nadig (@karthiknadig) Thanks a lot. It works great! By the way I think the pyenv-win is supported. Why the issue #15304 is still marked as "needs decision"? It is just a little confuse. But it is OK. It works! Thanks again! 👍
ulises-castro commentedon Mar 31, 2021
For my case, What it was worked:
ravigomez commentedon Aug 16, 2021
For me it worked on windows. I used "python.defaultInterpreterPath": "%USERPROFILE%.pyenv\pyenv-win\bin"