vscode-python: Gets stuck at "Python extension loading" then extension host crashes when `telemetry.enableTelemetry` is set to `false`
There’s a few other mentions of this but no fixes so far.
Environment data
- VS Code version: Noticed after upgrade to 1.52, kept happening after downgrade to 1.51.
- Extension version (available under the Extensions sidebar): v2020.12.422005962
- OS and version: Windows 10 2004
- Python version (& distribution if applicable, e.g. Anaconda): 3.9, same on 3.91
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
- Relevant/affected Python packages and their versions: All
- Relevant/affected Python-related VS Code extensions and their versions: Base Python extension
- Value of the
python.languageServer
setting: Pylance
Expected behaviour
Message disappears and extension eventually loads.
Actual behaviour
Message doesn’t disappear, extension doesn’t load, “Extension host terminated unexpectedly” message appears.
Steps to reproduce:
- Start VSCode
- Select a python file to trigger the extension loading.
Was also able to reproduce after separately:
- reinstalling VScode
- recreating %userprofile%.vscode
- recreating %appdata%\Code
- Updating python to 3.91
- Enabling only the Python extension
Logs
Total output of OUTPUT > Python. Extension host crashes after it sits at this for a while.
Info 2020-12-15 16:12:53: Searching for workspace virtual envs in: d:\users\ben\Documents\advent-of-code-2020
Info 2020-12-15 16:12:53: Searching for workspace virtual envs in: d:\users\ben\Documents\advent-of-code-2020\.direnv
Info 2020-12-15 16:12:53: Searching for global virtual envs in: C:\Users\Ben\Envs
Info 2020-12-15 16:12:53: Searching for global virtual envs in: C:\Users\Ben\.direnv
Info 2020-12-15 16:12:53: Searching for global virtual envs in: C:\Users\Ben\.venvs
Info 2020-12-15 16:12:53: Searching for global virtual envs in: C:\Users\Ben\.virtualenvs
Info 2020-12-15 16:12:53: Searching for global virtual envs in: C:\Users\Ben\.local\share\virtualenvs
User belongs to experiment group 'pythonaa'
User belongs to experiment group 'pythonSendEntireLineToREPLcf'
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 15
- Comments: 74 (10 by maintainers)
Commits related to this issue
- fix(vscode): fix python extension loading see https://github.com/microsoft/vscode-python/issues/14977#issuecomment-919565210 — committed to hi-ogawa/config by hi-ogawa 3 years ago
I had same issue too
Version: 1.56.0 (user setup) Commit: cfa2e218100323074ac1948c885448fdf4de2a7f Date: 2021-05-04T22:09:06.405Z Electron: 12.0.4 Chrome: 89.0.4389.114 Node.js: 14.16.0 V8: 8.9.255.24-electron.0 OS: Windows_NT x64 10.0.19041
Python : 3.8.10
"telemetry.enableTelemetry": false
Hi all,
You can temporarily fix this by adding following User setting as a workaround:
But in order to fix it properly, we need more info:
User belongs to experiment group
which are important to us:Experiencing this too. It seems that it is a regression in the latest release. It causes a memory leak on my Windows 10 machine (memory usage spikes up to 2-3 GB) and the status bar shows “Python extension loading” forever.
I have to downgrade to the previous version because of this.
There seems to be many duplicates of this in the last few hours
Well, I’d rather not enable telemetry globally. I hope this issue is getting fixed soon. The extension should be functional without experiment framework.
Thank you, I’m able to reproduce this. Both of your settings, tim-settings.txt & abhi-settings.txt have a setting in common:
telemetry.enableTelemetry
set tofalse
. Removing that setting fixes the issue for me!It seems VSCode disables the experiment framework if telemetry is disabled, so you were opted out of the discovery experiment.
@kmsbio
"telemetry.enableTelemetry": false
the reason that works is because disabling telemetry also disables the experiments. You can instead specifically disablepython.experiment.optOutFrom: ["pythonDiscoveryModule", "pythonDiscoveryModuleWithoutWatcher"]
.I recommend filing bug with cpu profile and any other details with
pythonDiscoveryModuleWithoutWatcher
on. So we can figure out what is going on with that. That module will soon replace the existing discovery module.Yes, we plan to remove the non-experiment code which should fix this issue for you.
Thank you, @karrtikr I confirm that removing
telemetry.enableTelemetry
fixes the issue.Mine has
User belongs to experiment group 'pythonDiscoveryModuleWithoutWatcher'
if"python.experiments.optInto": ["pythonDiscoveryModuleWithoutWatcher"]
is set manually. Otherwise none at all.Same problem here, disabling telemetry did not help, I use insider Python (daily) and insider Pylance (daily).
I have to enable 2 settings for this to work, not only
telemetry.enableTelemetry
:I am also observing issues on
v2020.12.424452561
. I uninstalled Python, Pylance, and Jupyter, quit VS Code, and deleted all of them from my filesystem. Upon reinstalling them, the extension host immediately crashed.I just removed the Python (ms-python.python) extension, which just got updated to version v2020.12.422005962 and manually reinstalled v2020.11.371526539, and now it is working just fine. The v2020.12 got released 18 hrs ago, so there is probably a bug there.
I had set
"python.experiments.disabled": true,
and"python.experiments.optOutFrom": ["All"],
. Setting these broke the discovery of my tests and stuck “Python extension loading” permanently at the bottom of my window.When I removed them from my (user) settings.json, things were fixed.
Props to @Timsonrobl for providing me enough insight 😃
PS: Am posting this in case someone comes from google trying to find out why their Python extension doesn’t load and why vscode can’t find their tests :p
Also experiencing infinite loading of the Python extension
v2021.9.1230869389
right now. Mysettings.json
is empty. There is a python.exe (3.9.5 x64) in my PATH, and also a venv in my current folder. I do not use Conda anywhere, don’t get, why it’s in the log below.Output of Python
VS Code version
Thank you for your work at this extension!
I have the same “Python extension loading forever” issue when using a remote container for development (ssh+docker container on the ssh-host). For me it started working again once I setup a python(+pylance) interpreter on the local host. After that the remote one started working again as well 🤷♂️. Idk if this is the real cause though… I’ve been frantically trying configurations and am just glad it is working again 💫 😵 .
Version: 1.55.2 (Universal) Commit: 3c4e3df9e89829dce27b7b5c24508306b151f30d Date: 2021-04-13T09:36:32.643Z Electron: 11.3.0 Chrome: 87.0.4280.141 Node.js: 12.18.3 V8: 8.7.220.31-electron.0 OS: Darwin x64 20.3.0
(Remote ssh-host on ubuntu 20.04 as root and remote container using docker)
Update 1: it stopped working for me again, even with the local running python extension. I did notice however that vscode seems to confuse containers in regards of extensions. I installed the python extension in one container and saw a notification in a different container that the new extension was installed. So it seems to get something mixed up there. This is all wild guessing though and might have nothing to do with this issue.
Update 2: After more playing around it started working again when I disabled all the “Experiments” in settings.
🤷♂️ let’s see if it continues to work for longer now.
I had the same issue and disabling telemetry helped. In my case, the remote machine has no internet access. Maybe adding a timeout or proper error handling can fix this issue.
Same issue with Python extension not loading and preventing many other extensions from loading.
Adding
"telemetry.enableTelemetry": false
to settings.json has solved (or hidden) the issue.Version: 1.58.0 (user setup) Commit: 2d23c42a936db1c7b3b06f918cde29561cc47cd6 Date: 2021-07-08T06:54:55.083Z Electron: 12.0.13 Chrome: 89.0.4389.128 Node.js: 14.16.0 V8: 8.9.255.25-electron.0 OS: Windows_NT x64 10.0.19043
I had the same problem here.
Version: 1.55.2 (user setup) Commit: 3c4e3df9e89829dce27b7b5c24508306b151f30d Date: 2021-04-13T09:35:57.887Z (2 wks ago) Electron: 11.3.0 Chrome: 87.0.4280.141 Node.js: 12.18.3 V8: 8.7.220.31-electron.0 OS: Windows_NT x64 10.0.18363
venv with Python 3.8.8 64-bit
@karrtikr attached please find, hoping it does help. CPU-20210220T220758.224Z.cpuprofile.zip
Ooutput -> Python:
Settings.json:
I removed python extension, removed copies of it in ~/.vscode-server/extensions , but still running into the same problem after re-installing python extension.
Running the new version
2020.12.424027540
but still experiencing the same issue.We just released another version (2020.12.424027540) with a potential fix for this issue. Please try it out, and let us know.