GetInterpreterList does not pick up newly added virtual environments (when called from Jupyter)
See original GitHub issueEnvironment data
- VS Code version: Insiders latest
- Extension version 2021.10.1258668113-dev
- OS and version: Windows 10
- Python version (& distribution if applicable, e.g. Anaconda): XXX
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): XXX
- 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: XXX
[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
Virtual environments just created will end up in list of kernels.
Actual behaviour
Virtual environments do not appear as kernels
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
- Create virtual env outside of vs code
- Open VS code in same root folder
- Open notebook
- New venv is not selectable as a kernel.
- Open python file
- New venv is selectable as a python interpreter.
This test run is failing for the same reason: https://github.com/microsoft/vscode-jupyter/runs/3669744903?check_suite_focus=true
Logs
Here’s the logs from jupyter. Notice how the venv ‘testDummyVenv’ is not listed. jupyterlog.txt
Here’s the logs from python. venv ‘testDummyVenv’ is listed. pythonlog.txt
We (Jupyter) are not getting the new venv when calling getInterpreterList. This seems like a recent regression.
Issue Analytics
- State:
- Created 2 years ago
- Comments:15
Top GitHub Comments
@rchiodo If
resource
is passed asundefined
, workspace envs are not reported as the VSCode API needs a URI:vscode.workspace.getWorkspaceFolder(uri)
, I think that’s what is happening.In the extension we get the resource using https://github.com/microsoft/vscode-python/blob/c383e81e66a220f509dc38821700160e38784d55/src/client/interpreter/configuration/interpreterSelector/commands/base.ts#L33-L81
Tests seem to be reproing this. I believe there’s still a problem with untitled files. At least during our tests running.