Failed to start virtual environment on git bash #22961
Labels
info-needed
Issue requires more information from poster
triage-needed
Needs assignment to the proper sub-team
Type: Bug
Behaviour
Expected vs. Actual
When opening a git bash terminal on windows the python virtual environment does not start.
Steps to reproduce:
Have a python project with a virtual environment in the same directory called .venv.
Open a new virtual environment.
I expected the virtual environment to be activated, however, which python shows it is not.
I have validated that in my settings I have: "python.terminal.activateEnvironment": true
The output of the python output panel was added below.
Note: I have manually ran the . ./.venv/Scripts/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2024.0.1/pythonFiles/printEnvVariables.py command and validated it returns a proper dictionary.
however, I see it continues with C:/Program Files/Python39/python.exe.
In addition, it sends this to the terminal, however, the terminal is git bash which should have a different format (/c/Program Files/Python39/python for the original python).
I also see that when I run source .venv/Scripts/activate and do "which python" I am seeing:
/c/Users/assafme/projects/azure_infra/\Users\assafme\projects\azure_infra.venv/Scripts/python
which doesn't seem right.
Diagnostic data
python.languageServer
setting: DefaultOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)User Settings
Extension version: 2024.0.1
VS Code version: Code 1.86.2 (903b1e9d8990623e3d7da1df3d33db3e42d80eda, 2024-02-13T19:40:56.878Z)
OS version: Windows_NT x64 10.0.19045
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
A/B Experiments
The text was updated successfully, but these errors were encountered: