-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Python virtual environment not correctly activated in terminal with uv and WSL #243225
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
Comments
Try the workarounds recommended here: microsoft/vscode-python#24699 (comment) |
I tried the first option ( |
@diego-pm Thanks for letting us know. |
@karthiknadig I also found this bug and found the following phenomenon. |
@Dynamith I am working on a fix for activations in the https://github.com/microsoft/vscode-python-environments extension. That extension supports A work around for the above case is to add this to your user settings:
That will cause the extension to send the command to the terminal for activation. |
Uh oh!
There was an error while loading. Please reload this page.
Type: Bug
I am developing with python in WSL2, and using uv to create the virtual environment. However, when opening the integrated terminal of vs code, the virtual environment does not get automatically activated correctly.
It seems that it is automatically activated because the name of the environment appears in the prompt, but I cannot access the executables (such as python). Also, the reported python version is the system python version, not the python version of the virtual environment.
I need to manually activate the environment running
source ./.venv/bin/activate
. Then, I can correctly execute python use the libraries in the virtual environment from the terminal.VS Code version: Code 1.98.1 (2fc07b8, 2025-03-10T15:38:08.854Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 5.15.167.4-microsoft-standard-WSL2
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 (36)
(1 theme extensions excluded)
A/B Experiments
The text was updated successfully, but these errors were encountered: