You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Stuck at analyzing in background and causing high cpu load #1291
User belongs to experiment group 'AlwaysDisplayTestExplorer - control'
Starting Microsoft Python language server.
[Info - 10:33:32 AM] Analysis cache path: /home/kaushal/.cache/Microsoft/Python Language Server
[Info - 10:33:32 AM] GetCurrentSearchPaths /home/kaushal/microfinance/venv/bin/python
[Info - 10:33:33 AM] Interpreter search paths:
[Info - 10:33:33 AM] /home/kaushal/microfinance/venv/lib/python2.7
[Info - 10:33:33 AM] /home/kaushal/microfinance/venv/lib/python2.7/lib-dynload
[Info - 10:33:33 AM] /usr/lib/python2.7
[Info - 10:33:33 AM] /usr/lib/python2.7/plat-x86_64-linux-gnu
[Info - 10:33:33 AM] /usr/lib/python2.7/lib-tk
[Info - 10:33:33 AM] /home/kaushal/microfinance/venv/local/lib/python2.7/site-packages
[Info - 10:33:33 AM] /home/kaushal/microfinance/venv/lib/python2.7/site-packages
[Info - 10:33:33 AM] User search paths:
[Info - 10:33:35 AM] Microsoft Python Language Server version 0.3.21.0
[Info - 10:33:35 AM] Initializing for /home/kaushal/microfinance/venv/bin/python
.
.
.
Analysis of pandas.core.dtypes.dtypes(Library) completed in 5.9831 ms.
Analysis of pandas.core.dtypes.api(Library) completed in 0.7383 ms.
Analysis of pandas.io.json.table_schema(Library) completed in 1.6775 ms.
Analysis of pandas.core.indexing(Library) completed in 32.862 ms.
Analysis of pandas.util.testing(Library) completed in 49.5013 ms.
Analysis of pandas.core.sorting(Library) completed in 12.6855 ms.
Analysis of pandas.plotting._misc(Library) completed in 12.8782 ms.
Analysis of pandas.testing(Library) completed in 0.1046 ms.
Analysis of pandas.core.algorithms(Library) completed in 34.2249 ms.
Analysis of pandas.core.base(Library) completed in 21.2535 ms.
Analysis of pandas.core.missing(Library) completed in 21.3684 ms.
Analysis of pandas.core.util.hashing(Library) completed in 6.393 ms.
Analysis of pandas.core.indexes.frozen(Library) completed in 5.9272 ms.
Analysis of pandas.io.formats.format(Library) completed in 63.51 ms.
Analysis of pandas.core.internals(Library) completed in 101.1854 ms.
Yep. I was having the same problem before. It was resolved for a while by some updates, and now I'm having the same problem again immediately after updating to 1.36. My environment is:
VSCode 1.36.0
Server version 0.3.20.0
Python extension version 2019.6.22090
MacOS 10.14.5
Python 3.7.2 (via Pyenv, no virtual environment)
I'm not sure this could be related to any VS Code update; the same version of the language server would be downloaded by any version of VS Code (currently 0.3.20). This is likely something else.
We just built 0.3.22, which is available in the beta/daily channels. It contains some fixes which we believe will help solve some of the leaks. You can set this and reload to update:
[Info - 10:39:46 AM] Microsoft Python Language Server version 0.3.22.0
[Info - 10:39:46 AM] Initializing for /home/kaushal/microfinance/venv/bin/python
To be clear, we are asking for the code and installed package list that triggers this problem; it's not easy to fix something we can't reproduce and debug.
Ok, so looks like we have a bug with six.moves: #746
But it doesn't hang anything by itself. Kaushal Vora (@kaushall), do you have a file with a minimal repro or it requires a specific project?
do you have a file with a minimal repro or it requires a specific project?
No, ,maybe it's specific to project, because whichever file I open it will stuck randomly at analysis stage. Sometime it will stuck on Pandas library and sometime on Six library.
How it is reproduced?
Open vs code >> open project >> select python file >> After this it will activate extension and on analysis stage it will stuck.
proxy returns ReferenceType[Test], which has all of the members of Test, so when a specific type of ReferenceType is constructed, SetClassMembers iterates over the members of Test and creates specific types of them, adding Test as a base, presumably because Test is filling in some T in a generic. That's where this is going wrong.
Downloading https://pvsc.azureedge.net/python-language-server-stable/Python-Language-Server-win-x64.0.3.76.nupkg...
Language server dowload complete
Unpacking archive... done
[Info - 3:26:06 PM] Microsoft Python Language Server version 0.3.76.0
[Info - 3:26:07 PM] Analysis cache path: C:\Users\smcro\AppData\Local\Microsoft\Python Language Server
[Info - 3:26:07 PM] GetCurrentSearchPaths C:\Python37\python.exe
It's stuck at "Analyzing in background, 100 items left". It's using 1GB of RAM. It frequently gets into this state. Reloading the window spins a roulette wheel and has a chance of finishing, but it's not guaranteed.
Activity
raaaaaymond commentedon Jul 9, 2019
Yep. I was having the same problem before. It was resolved for a while by some updates, and now I'm having the same problem again immediately after updating to 1.36. My environment is:
VSCode 1.36.0
Server version 0.3.20.0
Python extension version 2019.6.22090
MacOS 10.14.5
Python 3.7.2 (via Pyenv, no virtual environment)
jakebailey commentedon Jul 9, 2019
I'm not sure this could be related to any VS Code update; the same version of the language server would be downloaded by any version of VS Code (currently 0.3.20). This is likely something else.
jakebailey commentedon Jul 9, 2019
We just built 0.3.22, which is available in the beta/daily channels. It contains some fixes which we believe will help solve some of the leaks. You can set this and reload to update:
kaushall commentedon Jul 10, 2019
Jake Bailey (@jakebailey)
I'm still facing this issue.
Current extension version (ms-python.python): 2019.6.24221
kaushall commentedon Jul 10, 2019
Here is the version of language server,
[Info - 10:39:46 AM] Microsoft Python Language Server version 0.3.22.0
[Info - 10:39:46 AM] Initializing for /home/kaushal/microfinance/venv/bin/python
AlexanderSher commentedon Jul 10, 2019
Do you have this repro on single unsaved document?
kaushall commentedon Jul 10, 2019
No, I've closed the Python file just for screenshot purpose.
Alexander Sher (@AlexanderSher)
jakebailey commentedon Jul 10, 2019
To be clear, we are asking for the code and installed package list that triggers this problem; it's not easy to fix something we can't reproduce and debug.
AlexanderSher commentedon Jul 10, 2019
Ok, so looks like we have a bug with
six.moves: #746But it doesn't hang anything by itself. Kaushal Vora (@kaushall), do you have a file with a minimal repro or it requires a specific project?
kaushall commentedon Jul 10, 2019
I understand your concern and I'll try to provide maximum details I can. Jake Bailey (@jakebailey)
Alexander Sher (@AlexanderSher) It was working fine before the last update of the language server.
How it is reproduced?
AlexanderSher commentedon Jul 10, 2019
Can you add a new python file to your project with only
import pandas, and attach full log as a file to the bug?kaushall commentedon Jul 10, 2019
Alright, Provide me few minutes. Alexander Sher (@AlexanderSher)
kaushall commentedon Jul 10, 2019
Alexander Sher (@AlexanderSher) I tried with your instruction and analysis completed successfully this time.
AlexanderSher commentedon Jul 10, 2019
Ok, so
pandasworks by itself. Can you add to this new file all imports from the file that hangs, close all files, restart VSC and open this new file?kaushall commentedon Jul 10, 2019
Alexander Sher (@AlexanderSher) It stuck again, Here is the result:
15 remaining items
jakebailey commentedon Jul 11, 2019
proxyreturnsReferenceType[Test], which has all of the members ofTest, so when a specific type ofReferenceTypeis constructed,SetClassMembersiterates over the members ofTestand creates specific types of them, addingTestas a base, presumably becauseTestis filling in someTin a generic. That's where this is going wrong.kaushall commentedon Jul 12, 2019
Jake Bailey (@jakebailey) Alexander Sher (@AlexanderSher) Mikhail Arkhipov (@MikhailArkhipov) Thanks for fixing the issue and your hard work.
Is this fix available in beta/daily channel?
jakebailey commentedon Jul 12, 2019
Yes, in daily, 0.3.27 and above.
kaushall commentedon Jul 15, 2019
Issue seems to be fixed now. Thank you Jake Bailey (@jakebailey) Alexander Sher (@AlexanderSher) Mikhail Arkhipov (@MikhailArkhipov)
xobs commentedon Sep 18, 2019
I'm experiencing this issue still.
It's stuck at "Analyzing in background, 100 items left". It's using 1GB of RAM. It frequently gets into this state. Reloading the window spins a roulette wheel and has a chance of finishing, but it's not guaranteed.
xobs commentedon Sep 18, 2019
Additionally, it's saying I have undefined variables such as
isinstance,hasattr, andrange. These aren't variables they are Python keywords.marcelorosensaft commentedon Oct 2, 2020
Hello,
I'm new here and I have the same problem. I read this and several other threads that were closed after the problem was solved but mine is still here.
What should I provide to get my problem solved and be able to continue using VSCode?
Thank you in advance,
Marcelo
MikhailArkhipov commentedon Oct 2, 2020
marcelorosensaft - Try
Pylancelanguage server instead. It is on the VS Code marketplace.marcelorosensaft commentedon Oct 4, 2020
Thank you, Mikhail!
I installed PyLance and it seems to work very well
baltimoreguy8 commentedon Aug 2, 2021
Here is how I solved this issue:
Go to File > Preferences > Settings > "python.language server"
If set to 'Microsoft' change your language server to 'Pylance'
Reload your Visual Studio Code
Try importing your libraries causing the issues again: