Skip to content
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

Failed to start virtual environment on git bash #22961

Closed
chkp-assafme opened this issue Feb 25, 2024 · 1 comment
Closed

Failed to start virtual environment on git bash #22961

chkp-assafme opened this issue Feb 25, 2024 · 1 comment
Assignees
Labels
info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@chkp-assafme
Copy link

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 version (& distribution if applicable, e.g. Anaconda): 3.9.10
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
  • Value of the python.languageServer setting: Default
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

2024-02-25 12:27:06.032 [info] Experiment 'pythonRecommendTensorboardExt' is active
2024-02-25 12:27:06.032 [info] Experiment 'pythonREPLSmartSend' is active
2024-02-25 12:27:06.032 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2024-02-25 12:27:06.032 [info] Experiment 'pythonTestAdapter' is active
2024-02-25 12:27:06.032 [info] Default formatter is set to ms-python.black-formatter for workspace c:\Users\assafme\projects\azure_infra
2024-02-25 12:27:06.059 [info] Test server listening.
2024-02-25 12:27:06.509 [info] Python interpreter path: .\.venv\Scripts\python.exe
2024-02-25 12:27:17.139 [info] > . ./.venv/Scripts/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2024.0.1/pythonFiles/printEnvVariables.py
2024-02-25 12:27:17.139 [info] shell: bash
2024-02-25 12:27:17.437 [info] > conda info --json
2024-02-25 12:27:18.684 [info] > ./.venv/Scripts/activate.bat && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2024.0.1/pythonFiles/printEnvVariables.py
2024-02-25 12:27:18.684 [info] shell: commandPrompt
2024-02-25 12:27:30.910 [info] > C:\Program Files\Python39\python.exe ~/.vscode/extensions/ms-python.python-2024.0.1/pythonFiles/printEnvVariables.py
2024-02-25 12:27:30.911 [info] shell: bash
2024-02-25 12:27:34.970 [info] Starting Pylance language server.
2024-02-25 12:27:35.474 [info] Send text to terminal: "C:/Program Files/Python39/python.exe" c:\Users\assafme\.vscode\extensions\ms-python.python-2024.0.1\pythonFiles\printEnvVariablesToFile.py c:\Users\assafme\.vscode\extensions\ms-python.python-2024.0.1\pythonFiles\deactivate\bash\envVars.txt
2024-02-25 12:27:36.277 [info] Discover tests for workspace name: undefined - uri: c:\Users\assafme\AppData\Roaming\Code\User\settings.json
2024-02-25 12:27:37.570 [info] Discover tests for workspace name: undefined - uri: c:\Users\assafme\AppData\Roaming\Code\User\settings.json
2024-02-25 12:28:05.496 [error] Failed to initialize deactivate script C:\Program Files\Git\bin\bash.exe Error: "c:\Users\assafme\.vscode\extensions\ms-python.python-2024.0.1\pythonFiles\deactivate\bash\envVars.txt" file not created
    at Timeout.<anonymous> (c:\Users\assafme\.vscode\extensions\ms-python.python-2024.0.1\out\client\extension.js:2:276484)
    at listOnTimeout (node:internal/timers:569:17)
    at processTimers (node:internal/timers:512:7)

User Settings


languageServer: "Pylance"

terminal
• activateEnvironment: {"logLevel":"debug"}

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
Item Value
CPUs 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz (8 x 2419)
GPU Status 2d_canvas: enabled
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
Load (avg) undefined
Memory (System) 15.66GB (2.48GB free)
Process Argv --crash-reporter-id d82aa3f8-2eaf-4dd7-be03-17f23b42736a
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:30899288
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialog:30910333
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
pythontbext0:30879054
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
pydisww2:30959801
8082a590:30971561
edj9j583:30969295
7j2b6412:30969109
ccp2r6:30958158

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Feb 25, 2024
@karrtikr
Copy link

Closing as duplicate of #22910, please change your default shell and try out the pre-release version of the extension.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Feb 26, 2024
@karrtikr karrtikr closed this as not planned Won't fix, can't repro, duplicate, stale Feb 26, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants