Repository navigation
Terminal python launch command not working ? or not stable ? #25293
Description
Activity
- addedtriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
on Jul 17, 2025 I encountered the same issue. After selecting the interpreter in the bottom right corner, the terminal shows the current conda virtual environment next to the username. However, this environment is invalid. When I run Python-related commands, it still uses the system’s default Python interpreter. Only after manually activating the desired virtual environment again in the terminal does the correct Python interpreter take effect.
Reacted by gitcxx123Hello!
Thanks for sharing.
Could you explicitly say how you "manually activated the desired virtual environment again" ??
I have been trying to do so for hours now and still when I launch a file like so "python file.py" from a terminal (in VS) then a default environment is used and none of the libraries are found (e.g. numpy etc.)
Thanks for your help!- changed the title
[-]Terminal python launch command not working[/-][+]Terminal python launch command not working ? or not stable ?[/+]on Jul 17, 2025 Following huixuanling's advice, it turns out indeed that the correct environment is effectively loaded only once it is manually re-activated (e.g. conda activate ...).
Let's point out that the environment is not correct even though now the name is properly prompted on the terminal (this is new to me).
However it looks this manual override must be done each time a terminal session is opened...
Can someone please advise and help ? Thanks
As for me, I turn off the Python Debugger extension. It works!
The same issue for me, and I noticed that
Run Python File in Terminalworks fine. Only when the terminal is manually opened does the issue occur.As for me, I turn off the Python Debugger extension. It works!
It also works for me!
Thanks for feedbacks!
Looks like the issue is being escalated by MS teams: see issues #25291 and #25284. Some fixes as of now:- roll back to VS code version 101 until fix is properly handled
- opt out from this update by adding this line in file ./.vscode/settings.json
- manually activate the environment at terminal launch session
- disable python debugger
On my side I have chosen to manually activate each time the environment in order to keep track of the coming fix.
As for me, I turn off the Python Debugger extension. It works!
me too, thanks! It has been bothering me for several days
Type: Bug
In Terminal
While launching a python file, the interpreter is not using the selected interpreter from the environment (conda env).
Instead it remains using the default recommended version and environment.
VS Code version: Code 1.102.1 (7adae6a56e34cb64d08899664b814cf620465925, 2025-07-15T16:41:17.147Z)
OS version: Windows_NT x64 10.0.26100
Modes:
System Info
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
Extensions (4)
A/B Experiments