Python venv not automatically activating when clicking the Play button #24639
Labels
bug
Issue identified by VS Code Team member as probable bug
triage-needed
Needs assignment to the proper sub-team
Type: Bug
Description: When running a Python script in VS Code, the virtual environment (venv) is not automatically activated, even though the interpreter is correctly selected. In the lower window, I see the interpreter "3.12.8 ('.venv': venv)", but when clicking the Play button, the venv is not activated (it does not appear in green as (venv) in the terminal).
Steps to Reproduce:
python -m venv .venv
.Expected Behavior:
The terminal should automatically activate the virtual environment (venv), and "(venv)" should appear in green in the terminal.
Actual Behavior:
The terminal does not automatically activate the virtual environment (venv), and "(venv)" does not appear in the terminal.
BUT: There is a hint shown by VS Code that it is activated even when not showing.
BUT: when then running a script, use the same terminal to install a pip package...it will be installed to the global environment, not to the "activated" venv
Additional Configuration Done:
Extension version: 2024.23.2024121801
VS Code version: Code 1.96.0 (138f619c86f1199955d53b4166bef66ef252935c, 2024-12-11T02:29:09.626Z)
OS version: Windows_NT x64 10.0.22631
Modes:
python.languageServer
setting: DefaultUser Settings
Installed Extensions
The text was updated successfully, but these errors were encountered: