Skip to content

Interpreter shown in the status bar is not the selected one on MacOS #16197

Description

Environment data

  • VS Code version: 1.57.0-insider commit 54d33cf
  • Extension version (available under the Extensions sidebar): 2021.5.821509413-rc
  • OS and version: macOS Big Sur 11.2.3
  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.0a5 (global), 3.6.9 venv
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Relevant/affected Python packages and their versions: N/A
  • Relevant/affected Python-related VS Code extensions and their versions: N/A
  • Value of the python.languageServer setting: Pylance

Expected behaviour

Interpreter shown in the status bar should be the selected interpreter.

Actual behaviour

Interpreter shown is whatever the extension could find (it's not even the interpreter I use in python.defaultInterpreterPath and I opted into all experiments), in this case /usr/local/bin/python3.

Notes:

  • Opening a new terminal will activate the correct interpreter.
  • Selecting a different interpreter in the quickpick will update the status bar to the correct one.
  • Opening another Python file will also update the status bar.

Note the difference between the interpreter in the bottom left, and the current interpreter in the quickpick:

Screen Shot 2021-05-10 at 11 48 11 AM

Steps to reproduce:

  1. Open a Python project, install the extension, reload the window and wait for the extension to activate
  2. Notice that the interpreter shown in the status bar is not the one selected for the project

Logs

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

User belongs to experiment group 'All'
Python interpreter path: /usr/local/bin/python3
Error 2021-05-10 12:03:52: The .project file inside environment folder: /Users/kimiguel/.local/share/virtualenvs/hello-pipenv-two-dcBnVr68 doesn't contain a valid path to the project
Error 2021-05-10 12:03:52: The .project file inside environment folder: /Users/kimiguel/.local/share/virtualenvs/pipenv-two-KgBt83I1 doesn't contain a valid path to the project
Error 2021-05-10 12:03:53: The .project file inside environment folder: /Users/kimiguel/.local/share/virtualenvs/pipfile_hello_world-9fihYaKL doesn't contain a valid path to the project
Error 2021-05-10 12:03:53: The .project file inside environment folder: /Users/kimiguel/.local/share/virtualenvs/pytest-libfaketime-ChaRi4Fc doesn't contain a valid path to the project
Error 2021-05-10 12:03:53: The .project file inside environment folder: /Users/kimiguel/.local/share/virtualenvs/upper_level_project-hGd-hSjF doesn't contain a valid path to the project
Error 2021-05-10 12:03:53: The .project file inside environment folder: /Users/kimiguel/.local/share/virtualenvs/vscode_multi_workspace_bug_repro-mhhNtleX doesn't contain a valid path to the project
Starting Jedi language server.
Error 2021-05-10 12:03:53: Failed to check if file needs to be fixed EntryNotFound (FileSystemError): Unable to read file '/Users/kimiguel/Documents/Sandbox/simple-bot/.vscode/settings.json' (Error: Unable to resolve non-existing file '/Users/kimiguel/Documents/Sandbox/simple-bot/.vscode/settings.json')
    at _handleError (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87:156604)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at y.readText (/Users/kimiguel/.vscode-insiders/extensions/ms-python.python-2021.5.821509413-rc/out/client/extension.js:9:344717)
    at p.doesFileNeedToBeFixed (/Users/kimiguel/.vscode-insiders/extensions/ms-python.python-2021.5.821509413-rc/out/client/extension.js:59:581560)
    at /Users/kimiguel/.vscode-insiders/extensions/ms-python.python-2021.5.821509413-rc/out/client/extension.js:59:580687
    at async Promise.all (index 1)
    at p.getFilesToBeFixed (/Users/kimiguel/.vscode-insiders/extensions/ms-python.python-2021.5.821509413-rc/out/client/extension.js:59:580633)
    at p.updateTestSettings (/Users/kimiguel/.vscode-insiders/extensions/ms-python.python-2021.5.821509413-rc/out/client/extension.js:59:580260) {
  code: 'FileNotFound'
}
Python interpreter path: ./.venv37/bin/python

Metadata

Metadata

Labels

area-environmentsFeatures relating to handling interpreter environmentsbugIssue identified by VS Code Team member as probable bugimportantIssue identified as high-priorityinfo-neededIssue requires more information from posterregressionBug didn't exist in a previous release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions