Repository navigation
Virtual env not working in new terminal #22449
Copy link
Copy link
Closed as not planned
Labels
triage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
Description
Type: Bug
Steps to reproduce:
- Open workspace with venv
- In terinal, see that the venv is working
- Create a new terminal.
- 🐛 The new terminal still says I'm in a viritual environment but no venv functions work
On both the first and last lines, the $VIRTUAL_ENV environment variable isn't set
Diagnostic data
- Python version (& distribution if applicable, e.g. Anaconda): 3.11.5
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Global
- Value of the
python.languageServersetting: Default
Logs: logs.txt
languageServer: "Pylance"
Extension version: 2023.21.13121855
VS Code version: Code - Insiders 1.85.0-insider (Universal) (7771124, 2023-11-08T05:36:07.740Z)
OS version: Darwin arm64 23.1.0
Modes:
System Info
| Item | Value |
|---|---|
| CPUs | Apple M2 Max (12 x 24) |
| 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 video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: enabled |
| Load (avg) | 4, 3, 3 |
| Memory (System) | 64.00GB (6.72GB free) |
| Process Argv | --crash-reporter-id 0fffb5da-9cd7-46fd-9e7f-a1564e8c5fda |
| Screen Reader | no |
| VM | 0% |
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythontb:30258533
pythonptprofiler:30281269
vshan820:30294714
vscod805:30301674
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30404738
py29gd2263:30784851
vsclangdf:30492506
c4g48928:30535728
dsvsc012:30540252
pynewext54:30618038
a9j8j154:30646983
showlangstatbar:30737417
pythonfmttext:30716741
fixshowwlkth:30771523
showindicator:30805243
pythongtdpath:30726887
i26e3531:30792625
welcomedialog:30812478
pythonnosmt12:30779711
pythonidxpt:30768918
pythonnoceb:30776497
dsvsc013:30777762
dsvsc014:30777825
pythonmhint1:30859868
dsvsc015:30821418
pythontestfixt:30866404
pythonregdiag2:30871582
pyreplss1:30879911
pythonmypyd1:30859725
pythoncet0:30859736
pythontbext0:30879054
accentitlementst:30870582
dsvsc016:30879898
dsvsc017:30880771
dsvsc018:30880772
aa_t_chat:30882232
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
triage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team

Activity
karrtikr commentedon Nov 9, 2023
There're two issues here, venv not activating and
deactivatenot working, let's tackle it one by one. Try installing https://github.com/microsoft/vscode-python/suites/18034939925/artifacts/1038232381 and do the steps to reproduce just the first issue (VIRTUAL_ENVnot being set) without running any deactivate commands, and please report the logs again.mjbvz commentedon Nov 9, 2023
Not seeing today updating both vscode insiders and python insiders. Will reopen if I start hitting it again
BTW what's that build? Does it have extra logging or something that the normal insiders doesn't?
karrtikr commentedon Nov 9, 2023
It has extra logging plus a potential fix. Looking at the logs it seems the issue was reproduced from the fact that the active editor opened was outside the workspace (
.zshrcin this case). I had corrected it to handle that.If active editor opened is outside the editor, activate the first wor…