Skip to content

Venv not being activated in terminal #24810

@AWH1122

Description

@AWH1122

Type: Bug

Behaviour

When using a venv, if I run a file using the run button provided by VS Code, the correct Python binary is used. If I go to the terminal and run which python I can see that the active binary is /usr/bin/python.

This issue does not seem to occur when using conda environments. I am using wsl with zsh and oh my zsh. I can see that oh my zsh is showing that the environment is active even though it isn't. Not sure if this is helpful or not.

Image

Steps to reproduce:

  1. Create a venv
  2. Select venv as the active interpreter
  3. Open a new terminal
  4. Run which python
  5. Observe venv has not been automatically activated

Diagnostic data

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

N/A

Extension version: 2025.0.0
VS Code version: Code 1.97.1 (e249dada235c2083c83813bd65b7f4707fb97b76, 2025-02-10T13:13:58.153Z)
OS version: Windows_NT x64 10.0.22631
Modes:
Remote OS version: Linux x64 5.15.167.4-microsoft-standard-WSL2

  • Python version (& distribution if applicable, e.g. Anaconda): 3.13.1
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
copilot Git 1.270.0
copilot-chat Git 0.24.0
cpptools ms- 1.23.6
datawrangler ms- 1.18.1
debugpy ms- 2025.0.0
intellicode-api-usage-examples Vis 0.2.9
js-debug ms- 1.97.1
jupyter ms- 2025.1.0
jupyter-renderers ms- 1.1.0
latex-workshop Jam 10.7.5
path-intellisense chr 2.10.0
python ms- 2025.0.0
resourcemonitor mut 1.0.7
ruff cha 2025.8.0
vscode-clangd llv 0.1.33
vscode-js-profile-table ms- 1.0.10
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
vscode-pylance ms- 2025.2.1
vscodeintellicode Vis 1.3.2
System Info
Item Value
CPUs AMD Ryzen 9 3900X 12-Core Processor (24 x 3793)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.92GB (15.77GB free)
Process Argv --crash-reporter-id 672d1eda-f4ea-4625-a978-6966492cb88b
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu
OS Linux x64 5.15.167.4-microsoft-standard-WSL2
CPUs AMD Ryzen 9 3900X 12-Core Processor (24 x 0)
Memory (System) 15.58GB (13.32GB free)
VM 0%
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt551cf:31179979
vscod805cf:30301675
binariesv615:30325510
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dwnewjupytercf:31046870
nativerepl1:31139838
pythonrstrctxt:31112756
nativeloc2:31192216
iacca1:31171482
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530
6074i472:31201624
5a9hg449:31230677
9064b325:31222308
copilot_t_ci:31222730
jda6j935:31233686

Metadata

Metadata

Assignees

Labels

triage-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