-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
virtualenv environment in remote scenario is not activated in terminal #23962
Comments
Hello @kguryanov Thanks for filing the issue. Are you on a multi-root workspace? |
Hi @anthonykim1 Original issue is reported for regular workspace (aka open folder) Making it a multi-root is a |
@kguryanov Got it, that is pretty interesting.. Are you able to add:
in your settings.json and see if you can repro the same problem? It seems that you are only seeing the "activation command" when additional workspace folder is added. |
Hi @anthonykim1
That actually worked.
After VSCode window reload, the venv started activating in terminal There is, however, a little side effect:
After terminal relaunch, venv fails to activate once again, same as in original report. However, closing the terminal and opening it again, activates venv in terminal successfully once again.Is there a reproducible way to trigger terminal env update and cause VSCode to prompt to relaunch the terminal? I believe some extensions may trigger that prompt upon installation, but I am not sure. |
@kguryanov Glad that worked out - Make sure you add that setting line to both your user and workspace settings so that you don't have to remember to add the setting everytime. Once the Python extension detects that you have added that setting, we wont try to add environment variables in the terminal for you. - Thanks! |
Type: Bug
Behaviour
When using a non-multi-root workspace,
virualenv
environment is not being activated in the terminalEnvironment:
2.1. Ubuntu version:
Steps to reproduce:
/tmp/tmp.kQw8PyhiV3
)test.py
(the virtual environment is correctly identified)Actual result:
1, pyenv environment is actually activated in terminal though the hower over the terminal name states that the local


virtualenv
one is activated:2, Reloading workspace does not change the behavior
3. Current config:
Expected result:
virualenv
environment to be activated:Notes:
Notes 2:
1, The command from logs seem to activate manually

Diagnostic data
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Extension version: 2024.12.3
VS Code version: Code 1.92.2 (fee1edb8d6d72a0ddff41e5f71a671c23ed924b9, 2024-08-14T17:29:30.058Z)
OS version: Windows_NT x64 10.0.22631
Modes:
Remote OS version: Linux x64 5.15.153.1-microsoft-standard-WSL2
Remote OS version: Linux x64 5.15.153.1-microsoft-standard-WSL2
python.languageServer
setting: DefaultUser Settings
Installed Extensions
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
A/B Experiments
The text was updated successfully, but these errors were encountered: