vscode-python: Terminal doesn't activate selected conda environment

Type: Bug

Behaviour

Expected vs. Actual

I am using Windows 10 and Anaconda for virtual environments. recently, I change from spyder to vs code. it works fine. But yesterday, when I started a new terminal or run a python file, new terminal did not activate the selected virtual env (Conda). It DO work before. But didn’t after I installed the follows on Friday.

  1. New Python (3.9.9) outside of Anaconda to test a simple web server.
  2. WSL 2 and Docker for RATH (https://rath.kanaries.net/).

currently, I tried to uninstall New Python (3.9.9) and reinstall vs code (after delete everything, it’s a clean new install), but still doesn’t work. I know this is the same issue as #20885, but I tried all solutions mentioned in # 20885 and failed.

XXX

Steps to reproduce:

  1. Install new Python (3.9.9) outside of Anaconda to test a simple web server.
  2. WSL 2 and Docker for RATH (https://rath.kanaries.net/).

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.10
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Conda
  • 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


condaPath: "<placeholder>"

languageServer: "Pylance"

terminal
• executeInFileDir: "<placeholder>"

Extension version: 2023.16.0 VS Code version: Code 1.82.2 (abd2f3db4bdb28f9e95536dfa84d8479f1eb312d, 2023-09-14T05:55:25.390Z) OS version: Windows_NT x64 10.0.19045 Modes:

System Info
Item Value
CPUs Intel® Xeon® Gold 5122 CPU @ 3.60GHz (8 x 3592)
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) undefined
Memory (System) 62.66GB (54.99GB free)
Process Argv –crash-reporter-id 72a488d0-fc85-4685-952b-366d42b0aba1
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30410667
py29gd2263cf:30792227
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
3biah626:30602489
89544117:30613380
showlangstatbar:30737416
962ge761:30841074
03d35959:30757346
pythonfmttext:30731395
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
pythonnosmt12:30797651
pythonidxptcf:30805731
pythonnoceb:30805159
copilotsettingt:30839829
synctok:30821570
dsvsc013:30795093
dsvsc014:30804076
diffeditorv2:30821572
pythonmpsinfo:30842941
dsvsc015:30829745

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Comments: 22

Most upvoted comments

@karrtikr

Thanks a lot for your help. I switched to pre-release version and found it’s very fast to re-load window. Maybe only 1 or 2 sec. I even cannot see the indicator. Also, I close the vs code and start again to try to reproduce the issue. But I failed to reproduce it with pre-release version.

And then I switched back to release version and tried again. I can reproduce the issue, and re-activation of environment need about 5-10 sec. I think it’s not a long time.

That’s all. Thanks again.

No worries! I’ll just make the quick fix to show a progress indicator to help you with how long it takes to re-activate the environment, after which we can close this. Thanks for the help.