Skip to content

VS Code cannot activate Python virtual environments outside the workspace #25649

@hermitguo

Description

@hermitguo

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.106.3
  • OS Version: ubuntu budgie 24.04.03 + x11 + 6.14.0-35-generic

Steps to Reproduce:

  1. create .vscode
  2. settings launch.json
    { "version": "0.2.0", "configurations": [ { "name": "Python Debugger: Current File", "type": "debugpy", "python": "/opt/pyenv/erp19py3.13/bin/python3", "request": "launch", "program": "${file}", "console": "integratedTerminal" }, { "name": "ERP19Linux", "type": "debugpy", "python": "/opt/pyenv/erp19py3.13/bin/python3", "request": "launch", "program": "${workspaceFolder}/odoo-bin", "args": [ "-c", "${workspaceFolder}/odoo.conf", // "-u", // "estate", // "--dev=xml" ], "console": "integratedTerminal", "justMyCode": false, }, ] }
  3. settings launch.json
    { "cSpell.words": [ "odoo", "logfile" ], "terminal.integrated.profiles.linux": { "pyenv": { "path": "bash", "args": [ "-c", "source /opt/pyenv/erp19py3.13/bin/activate; exec bash -i" ] } }, "terminal.integrated.defaultProfile.linux": "pyenv", "python.terminal.activateEnvironment": false, "python.defaultInterpreterPath": "/opt/pyenv/erp19py3.13/bin/python" }
Image Image Image Image Image Image

####################### Expected result ################

  1. Opening VS Code should activate the corresponding virtual environment
  2. Ctrl+shit+p displays the corresponding virtual environment when manually entering a path

Metadata

Metadata

Labels

area-environmentsFeatures relating to handling interpreter environmentsarea-terminalinfo-neededIssue requires more information from postertriage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions