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

venv doesn't load on startup, on new terminal, or on switching associated interpreter on Gitbash #22894

Closed
abf7d opened this issue Feb 9, 2024 · 9 comments
Assignees
Labels
experimenting Feature is part of an experiment info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@abf7d
Copy link

abf7d commented Feb 9, 2024

Type: Bug

Behaviour

Expected vs. Actual

I have python.terminal.activateEnvInCurrentTerminal is true. I expect that the detected virtual enviornment for my workspace should be activated when I open vs code. In a previous version, when the terminal opened, a line would print that read "source venv/scripts/activate", and then above the colored text that indicates folder location I would see the name of my environment "(venv)". That would happen also if I changed my interpreter that has a virtual enviornment associated with it. Now, neither appear on startup, on new terminal, and on interpreter change.

Steps to reproduce:

  1. open any .py file and leave the intergrated terminal open.
  2. close and reopen vscode.
  3. you will find that the enviroment is not activated.
  4. open a new terminal
  5. you will find that the enviroment is not activated.
  6. click on "Python: Select Interpreter" in command pallet
  7. select an interpreter with a virtual enviornment associated with it
  8. you will find that the enviroment is not activated.
  1. Open a python file and click on the python version number in the bar at the bottom fo the window and select an interpreter with a virtual enviornment associated with it
  1. you will find that the enviroment is not activated.

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.9.13
  • 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)

XXX

User Settings


languageServer: "Pylance"

testing
• unittestEnabled: true

Extension version: 2024.0.1
VS Code version: Code 1.86.1 (31c37ee8f63491495ac49e43b8544550fbae4533, 2024-02-07T09:08:20.941Z)
OS version: Windows_NT x64 10.0.22621
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 2304)
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) 31.76GB (10.86GB free)
Process Argv --folder-uri file:///c%3A/Work/Main/cyto-explorer --crash-reporter-id 988c9f31-fda6-4e85-8941-201cd5efc3df
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscorecescf:30445987
vscod805:30301674
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
accentitlementst:30887150
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
pydisww2:30959801
edj9j583:30958191
3ef8e399:30949928
bg6jg535:30958357

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

Please provide the debug logs which can help diagnose the issue:

  • Run Developer: Set log level command
  • Select Trace
  • Run Developer: Reload Window command
  • Provide the output:
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

Can you provide screenshots of how you're determining whether the environment has activated?

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Feb 10, 2024
@joamag
Copy link

joamag commented Feb 10, 2024

I'm also seeing this behavior in Windows.

@abf7d
Copy link
Author

abf7d commented Feb 10, 2024

I'm actually seeing it on two computers.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Feb 10, 2024
@karrtikr karrtikr added experimenting Feature is part of an experiment info-needed Issue requires more information from poster labels Feb 12, 2024
@karrtikr
Copy link

karrtikr commented Feb 12, 2024

Unfortunately I'm not able to reproduce the issue, so I would need the logs asked earlier to proceed.

@abf7d
Copy link
Author

abf7d commented Feb 14, 2024

Here are my logs. I apologize for the delay.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Feb 14, 2024
@abf7d
Copy link
Author

abf7d commented Feb 22, 2024

@karrtikr, just checking in on this

@karrtikr
Copy link

Can you provide screenshots of how you're determining whether the environment has activated?

@abf7d Can you please also provide the above info?

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Feb 26, 2024
@karrtikr
Copy link

Also, please try out the pre-release version of the extension and report back with the debug logs if the issue persists:

image

@karrtikr karrtikr changed the title venv doesn't load on startup, on new terminal, or on switching associated interpreter venv doesn't load on startup, on new terminal, or on switching associated interpreter on Gitbash Feb 26, 2024
@karrtikr
Copy link

Actually, it seems like you're using Git bash which isn't officially supported by the Python extension. Dup of #22957.

Closing in favor of #22910. Please try switching your default shell as instructed in the other issue.

@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
experimenting Feature is part of an experiment 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

3 participants