question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Select interpreter popup does not shown any system, pyenv or virtualenv choice.

See original GitHub issue

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.languageServer setting: 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.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:31 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ulises-castrocommented, Mar 31, 2021

For my case, What it was worked:

"python.defaultInterpreterPath": "/home/{USER}/.pyenv/versions/{PROJECT}/bin/python",
"python.experiments.enabled": true,
"python.experiments.optInto": [
    "pythonDiscoveryModule"
]
1reaction
karthiknadigcommented, Feb 20, 2021

@LeoAzLiu pyenv-win is detected in the new experimental version of the discovery code. You can get that by opting into it, ad this to your user settings:

"python.experiments.enabled": true,
"python.experiments.optInto": ["pythonDiscoveryModule"]

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS Code: Python Interpreter can't find my venv - Stack Overflow
When I try to set the Python Interpreter, it shows me only the Python installed in my machine and not the one in...
Read more >
Configure a virtual environment | PyCharm Documentation
Create a virtualenv environment. Do one of the following: Click the Python Interpreter selector and choose Add New Interpreter.
Read more >
Python: Creating a clean learning environment with pyenv ...
This is not intended to be a full tutorial explaining all of the ... We will use Homebrew to install pyenv, pyenv-virtualenv and...
Read more >
MATLAB pyenv - MathWorks
Use pyenv to change the default version or execution mode of the Python ® interpreter. These changes are persistent across different MATLAB ®...
Read more >
Python development using WSL 2 and Visual Studio Code
(WSL 1 does not include an actual Linux kernel, so some applications, ... Screenshot of the VS Code setup showing several selected options....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found