Recently updated my laptop, and after installing VS Code and Python on the new machine, I've noticed that the Python extension takes forever to load any time VS Code is (re)started. I haven't timed it exactly, but probably at least a minute or more, just to load an extension on a 'gaming' laptop with oodles (technical term!) of RAM, disk space, and processor power to spare.
Nothing particularly exotic as far as extensions loaded - Python (obviously), Pylance, Jupyter, Remote - WSL, Vim, Visual Studio Intellicode and vs-code icons. Even with everything disabled but Python, Pylance and Jupyter, it doesn't change - and the extension very obviously holding things up is the Python one.
Nothing too exotic about the Python install... vanilla 3.8.6, from python.org, using virtualenvs for development. Even with the base install, and nothing much beyond pylint, black and virtualenvwrapper-win installed via pip... this seems really, really, really odd.
Any ideas?
More particularly, python is only excruciatingly slow when ran in vscode's terminal for some reason, also vscode's terminal boots up very slowly too, but when python code is ran withpython main.py
it only takes a fraction of a second to finish the code. Also worth mentioning is that on mac, vscode terminal is completely normal and quick
For context: hello world takes around 5 seconds on my machine to execute, but takes a fraction of a second when ran directly from cmd, not vscode
Why is this happening? Is it possible to optimise vscode for faster python running time?
Videos
Recently updated my laptop, and after installing VS Code and Python on the new machine, I've noticed that the Python extension takes forever to load any time VS Code is (re)started. I haven't timed it exactly, but probably at least a minute or more, just to load an extension on a 'gaming' laptop with oodles (technical term!) of RAM, disk space, and processor power to spare.
Nothing particularly exotic as far as extensions loaded - Python (obviously), Pylance, Jupyter, Remote - WSL, Vim, Visual Studio Intellicode and vs-code icons. Even with everything disabled but Python, Pylance and Jupyter, it doesn't change - and the extension very obviously holding things up is the Python one.
Nothing too exotic about the Python install... vanilla 3.8.6, from python.org, using virtualenvs for development. Even with the base install, and nothing much beyond pylint, black and virtualenvwrapper-win installed via pip... this seems really, really, really odd.
Any ideas?
Turns out vs-code icons is slow as heck on startup, you can see for yourself using CTRl+Shift+P: Developer: Startup performance. But the Python extension definitely gives me trouble too.
Can you post your environment parameters, like Operation System, VS Code version, Python version and extension version?
In another hand, VS Code is essentially a text editor, which depends on extensions to go on development, so it'll take some time to load python extension and environment.
Check if python extension uses high cpu load, and if it's indeed high, the production group explained in Extension cause high cpu load that:
All these cases are due to how the extension tries to find and figure out the details about the interpreter. We are in the process of refactoring the code that does interpreter discovery. One of the thing we are making sure is to reduce the number of python processes we create while figuring out interpreter info.
Another Python extension loading super slow is because production group
try to run python for each of the installed and know virtual environments. We are working on refactoring how we look for environments to avoid this on extension load.
I was just doing my stuff in vsc and at some point running my python scripts started taking whole 3 seconds for no reason, it was always instant to run, but now there is that delay that shouldn't be a thing. I'm not using any antiviruses or extensions, I can't see why did that problem occur out of nowhere, anyone has any ideas?
FIX: I fixed it! turns out i didn't completely remove vscode from my pc, so i deleted the config and cache folders and reinstalled vscode and it works perfectly now! still curious as to what the hell caused it...
at the bottom left of vscode it keeps saying "Python extension loading" and it never finishes, i tried reinstalling all the extensions, updating vscode, rebooting the system, and disabling the other extensions one by one, but to no avail.
it was working fine before, any help would be appreciated!
EDIT: im using linux (kubuntu 20.04) and i can't do anything python related (run scripts, formatters not working...etc)
I'm having a problem where the python extension has a very long loading time. I've tried unistalling and reinstalling but that hasn't worked. Any advice on what to do?
Recently I installed the python extension in my vscode. But the python extension is loading forever, I tried reinstalling, but it didn't fix my issue. I am using a M1 mac.
Please update the python extension to the latest version

or install the pre-release version directly. ( may be more useful to you )

this will basically solve your problem.
If the error continues, follow these steps:
- Uninstall Python extension (if you have pylance uninstall it first). Uninstall any other extension that is failing.
- Close all instances of VS Code.
- Go to, %USERPROFILE%/.vscode/extensions (on windows) or ~/.vscode/extensions on Linux/Mac.
- Delete any folder with the name starting with ms-python.python*
- Start VS Code, and install Python extension (also pylance if you uninstalled it in step 1).
I was having this issue and tried the above answer and it still didn't work. It turns out I hadn't installed python on my system yet. I didn't realize because I normally use it remotely.
From the VSCode documentation:
Quick start
- Step 1. Install a supported version of Python on your system (note: that the system install of Python on macOS is not supported).
- Step 2. Install the Python extension for Visual Studio Code.
- Step 3. Open or create a Python file and start coding!
I'm starting to mess around with python again in my free time and I'm having issues with the python extension. I only have 3 extensions installed. C#, PowerShell, & Python. All from Microsoft. I've uninstalled/reinstalled VS Code. I'm running 3.8.5 python.
When I try to add python (control + shift + p) it spins at loading the extension and comes back with reload, wait, or cancel. If you hit wait afew times, it will eventually load the python extension. The machine is an i7 4xxx, 32 gb of ram, ssd, ect.... I'm seeing no CPU, RAM, or Disk spikes during this time.
Has anyone seen anything like this before? Is there anything in the event viewer log that would help?
*** EDIT ***
I also tried it with the other extensions disabled.
So Basically ive had Vscode installed for a long time but recently it started running really slow.
here are some of the problems ive been having:
-
Every time i open a file it takes like over 10 seconds for it to open in vscode.
-
When i launch vscode, it shows up invisible then after 30 seconds i see the actual app.
-
When i look at extensions the details for them take 30 seconds to load in.
ive tried:
-
completley uninstalling and reinstalling vscode.
-
deleting all extensions.
-
restarting pc.
-
nothing is working.
extensions installed:
-
VSCode Discord RPC
-
Visual Studio IntelliCode
-
Python
-
Material Icon Theme
-
Material Theme
-
Java Extension Pack which includes:
-
Language Support for Java by red hat
-
Debbugger for Java
-
Java test runner
-
Maven for java
-
Java dependecy viewer
The issue from April is back and even fresh installs of VSC + python do not solve it.
I'm just wondering if this is something that anyone else has noticed, sometimes I'll get python completions fine and sometimes I'm expecting there to be a popup for a variable and it just doesn't happen to i end up typing it myself.