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.
"Code Analysis in progress" forever (never starts?) #1175
Python Language Server 0.2.87.0 (freshly deleted and reinstalled)
Python Extension version 2019.5.18678
VS Code 1.35.0
Linux RHEL 7
Code analysis never seems to properly finish? I have turned logging to Trace. The server starts, the Outline is created for whatever code is opened, but floating over any definition the float over text is just "Code Analysis in Progress" without end.
The only thing of note in the Python Ouput log just says Analysis of <whatever.whatever>(Library) Queued with no additional messages at any time no matter how long I wait. Go To Definition ability never loads.
The status bar, which used to show the (large but eventually decreasing to zero) number of files being analyzed, etc., now never says anything about analysis status. I feel like a few weeks ago it would show thousands/hundreds of files being analyzed, the number would gradually decrease, and then stop after a minute or two.
This no-definition-analysis behavior happens regardless of my "python.analysis.openFilesOnly" setting.
If I switch to Jedi, it quickly analyzes sufficiently to find definitions, so the issue goes away with Jedi. But, then I run into the Gitlens/Jedi outline symbols error, and have to turn off Gitlens. Any ideas?
I think it should be noted that hovering over a symbol only returns "Code analysis is in progress" (I googled this and the only result was the source code).
Reacted by Marcos Huerta, Jérémie "Sonnet 4.5" Lumbroso, aderchox and Mohammad Sekhavat
Seeing similar output. Could there be something with installed packages (another user in the issue referenced above mentioned seeing this in Conda – microsoft/vscode-docs#2741 (comment)):
this happens only when the selected interpreter is the one provided by conda
Here's what I've got installed in my environment (created through Poetry):
I think it should be noted that hovering over a symbol only returns "Code analysis is in progress" (I googled this and the only result was the source code).
Yep -this was the behavior that prompted me to open the issue!
Jake Bailey (@jakebailey) I sadly cannot provide the repo to reproduce, but the logs I posted in #1175 (comment) are all the logs I get with trace enabled :/ I do not think it ever starts at all.
Unfortunately that doesn't help too much due to the CLR stuff (the LS is in C# so it runs within the CLR), other than knowing that there's some deadlock. Getting a real trace of where it's stopped would be something we'd do in VS, but that's of course not as simple to emulate on Linux (probably doable with vsdbg but I haven't used it).
One thing to try is the daily build to see if it's gone away in a few fixes since 0.2.96, by setting:
Unfortunately that doesn't help too much due to the CLR stuff (the LS is in C# so it runs within the CLR), other than knowing that there's some deadlock. Getting a real trace of where it's stopped would be something we'd do in VS, but that's of course not as simple to emulate on Linux (probably doable with vsdbg but I haven't used it).
One thing to try is the daily build to see if it's gone away in a few fixes since 0.2.96, by setting:
"python.analysis.downloadChannel": "daily"
The daily download is not helping me, just tried it.
Happy to try vsdbg to get you a better trace, if someone can point me to some example
I have 0.3.15. My workspace interpreter path no longer has the workspace path. However it wasn't moved to the user search path and the package in the root of my workspace is still not resolvable.
Hmm, the fix wasn't supposed to move it down; the workspace root is always a search path even if it's not shown. Is the hang gone? Is it an import that goes unresolved, or something else? Do you have an example or updated repro? (Since I know you reported #537)
Ok, that's fair. The hang has been gone since I moved the ./lib and ./mod_tests to the extraPaths setting.
I found the issue. The package I wanted to resolve was mod_tests which is in my extraPaths. When I removed it from my extraPaths it became resolvable again. It seems that you have to decide whether to have a directory as an extraPath or a resolvable package. Sorry for the mix-up, in python both are allowable.
That is exactly what I was looking for. I wanted to keep general utility functions in mod_tests and also have the ability to import sub_tests directly as sort of plugins.
Hmm, I still have an issue. My workspace is like this:
folder1
folder2
folder3
with all folder1 -> folder3 added to my python path with .pth files for each. I also added all of them to the extra paths settings. They all show up as part of "user search paths" in the python log.
I also added to my workspace another folder, let's call it "astrowonk_code" which has other python files I want to be able to import from jupyter (thus why it has .pth file pointing to it)
Nothing in astrowonk_code is getting analyzed. the path shows up in "interpreter paths" but the outlines aren't getting created nor are any float over definitions working.
But astrowonk_code does get partially analyzed if I put it also in extra_paths (though the python log still shows it only under "interpreter search paths.") except it still shows "Analysis in progress.." over every definition tool tip. eventually there is just nothing when floating over functions. (The outline sometimes gets made? seems inconsistent.)
So most of my code the analysis is working properly, but not all. Looks like I'm on 0.3.15.0 of the LS.
(also the endless analysis still happens if I don't add folder1-3 into extrapaths. If autocomplete.extrapaths is unset, Code Analysis in Progress lasts forever, even if all the paths I would add to extrapaths show up in "interpreter search paths"
if I add astrowonk_code to the extrapaths then it still only appears in interpreter paths, but folder1-3 now appear in both. ¯_(ツ)_/¯
We only consider code within the workspace to be user code. Everything specified in extraPaths is split into what is and isn't in the workspace, then placed accordingly. My impression was that my_code was your workspace, so astrowonk_code is outside of it.
If it's library code, then many features will not operate within the module, though the outline should always appear (symbol collection is separate).
As for the hang, it's a bit difficult for me to make any judgement without seeing the trace log output, specifically the path list. The issue I had fixed was that the whole workspace was being marked as "interpreter", so I'd need another example that I can run that would have the hang.
I am using a virtual environment, with a Mac Ports interpreter. I keep experiencing the same problem, and a perpetual "Code Analysis in Progress..." What's the right information to report to be helpful?
I looked for .pth files (which I did not know of previously) and realized that some packages in my virtual environment use some:
Maybe this is expected, but I guess I am surprised that this affects the server entirely, even on examples that seem wholly unrelated, such as:
# VS code Version 1.35.1 (1.35.1)# Microsoft Python Language Server version 0.2.96.0classPerson(object):
defsay(self, msg:str):
print(msg)
deff() ->Person:
returnPerson()
a=f()
b=Person()
# Neither a. nor b. provide "say" as an option.
I have tried to reproduce the conditions of this problem without success. Here is what I did:
- I setup a blank environment with the same Pipfile (including the `mypack = {path = ".",editable = true}` line).
- I created the venv with pipenv, and used it as target interpret.
- I created a bogus `mypack` package with an empty `__init__.py` file.
- I created the `example.py` file above. This time the code analysis worked.
I am not sure, besides the actual content of the code in mypack what is missing from the above protocol compared to my original context.
By the way, I followed the instructions here to reinstall the most recent version and got the same above reinstalled, making me wonder if I should use the beta version:
Starting Microsoft Python language server.
Downloading https://pvsc.azureedge.net/python-language-server-stable/Python-Language-Server-osx-x64.0.2.96.nupkg
Utkarsh Jain (@QuantumStatic) Same, actually, although I love VS Code, I ended up just switching to PyCharm for all Python-only projects, which seems (for now) to have a more reliable, consistent Python intelligent support in my experience: https://www.jetbrains.com/pycharm/
Jérémie "Sonnet 4.5" Lumbroso (@jlumbroso) There is much customisations available but, if they don't fix it I'll have to shift 😔. I did start a new issue hoping it to get some traction.
Activity
bcroq commentedon Jun 7, 2019
After stopping/starting vscode multiple times, it finally analyzed the files.
Edit: all files are not analyzed :(
SmileyChris commentedon Jun 11, 2019
I'm getting the same behaviour -- no analysis happening:
Microsoft Python Language Server version 0.2.96.0
VS Code 1.35.0
Python Extension Version: 2019.5.18875
Ubuntu 19.04
Switching back to Jedi for now so I can keep working 😞
apollo13 commentedon Jun 14, 2019
Same here, with a trace log I am seeing:
Analysis is only queued.
Microsoft Python Language Server version 0.2.96.0
VS Code 1.35.1
Python Extension Version: 2019.5.18875
Debian unstable
kbakk commentedon Jun 17, 2019
I think it should be noted that hovering over a symbol only returns "Code analysis is in progress" (I googled this and the only result was the source code).
kbakk commentedon Jun 17, 2019
Seeing similar output. Could there be something with installed packages (another user in the issue referenced above mentioned seeing this in Conda – microsoft/vscode-docs#2741 (comment)):
Here's what I've got installed in my environment (created through Poetry):
pip list
astrowonk commentedon Jun 17, 2019
Yep -this was the behavior that prompted me to open the issue!
jakebailey commentedon Jun 17, 2019
If there's a repo that reproduces this, that'd be great. A copy of a trace log which shows the analysis stopping could be useful, too. https://github.com/microsoft/python-language-server/blob/master/TROUBLESHOOTING.md#filing-an-issue
apollo13 commentedon Jun 17, 2019
Jake Bailey (@jakebailey) I sadly cannot provide the repo to reproduce, but the logs I posted in #1175 (comment) are all the logs I get with trace enabled :/ I do not think it ever starts at all.
jakebailey commentedon Jun 17, 2019
Ah, my bad, I missed the trace lines in that output (distracted by the pylint text).
apollo13 commentedon Jun 17, 2019
Not sure if it is of any help, but this is a backtrace of the language server:
According to strace it never leaves this wait.
jakebailey commentedon Jun 17, 2019
Unfortunately that doesn't help too much due to the CLR stuff (the LS is in C# so it runs within the CLR), other than knowing that there's some deadlock. Getting a real trace of where it's stopped would be something we'd do in VS, but that's of course not as simple to emulate on Linux (probably doable with
vsdbgbut I haven't used it).One thing to try is the daily build to see if it's gone away in a few fixes since 0.2.96, by setting:
astrowonk commentedon Jun 17, 2019
The daily download is not helping me, just tried it.
Happy to try
vsdbgto get you a better trace, if someone can point me to some exampleapollo13 commentedon Jun 17, 2019
Jake Bailey (@jakebailey) Got you a reproducer: https://github.com/apollo13/vscode-bug -- Please follow the instructions in
README.md. If anyone else could confirm that this sequence also generates a hanging analysis…apollo13 commentedon Jun 17, 2019
Note: For me analysis starts working once I do not run
pip install -e .in the above example repo.jakebailey commentedon Jun 17, 2019
Thanks, I can reproduce it and have a fix. This is related to #1209, as well as #537 (comment).
15 remaining items
jaredcm commentedon Jun 17, 2019
I have 0.3.15. My workspace interpreter path no longer has the workspace path. However it wasn't moved to the user search path and the package in the root of my workspace is still not resolvable.
[Info - 4:56:51 PM] GetCurrentSearchPaths /Users/{user}/.pyenv/versions/3.7.2/bin/python
[Info - 4:56:51 PM] Interpreter search paths:
[Info - 4:56:51 PM] /private/var/folders/9q/mshp41rj5419tdv0ftt4bz380000gn/T/wbsqjziz.hqp
[Info - 4:56:51 PM] /Users/{user}/.pyenv/versions/3.7.2/lib/python3.7
[Info - 4:56:51 PM] /Users/{user}/.pyenv/versions/3.7.2/lib/python3.7/lib-dynload
[Info - 4:56:51 PM] /Users/{user}/.local/lib/python3.7/site-packages
[Info - 4:56:51 PM] /Users/{user}/.pyenv/versions/3.7.2/lib/python3.7/site-packages
[Info - 4:56:51 PM] User search paths:
[Info - 4:56:51 PM] /Users/{user}/Documents/Code/pymod_stress_test/lib
[Info - 4:56:51 PM] /Users/{user}/Documents/Code/pymod_stress_test/mod_tests
[Info - 4:56:52 PM] Microsoft Python Language Server version 0.3.15.0
jakebailey commentedon Jun 17, 2019
Hmm, the fix wasn't supposed to move it down; the workspace root is always a search path even if it's not shown. Is the hang gone? Is it an import that goes unresolved, or something else? Do you have an example or updated repro? (Since I know you reported #537)
apollo13 commentedon Jun 17, 2019
I am also on
now and it works fine again. Thanks!
jaredcm commentedon Jun 17, 2019
Ok, that's fair. The hang has been gone since I moved the ./lib and ./mod_tests to the extraPaths setting.
I found the issue. The package I wanted to resolve was mod_tests which is in my extraPaths. When I removed it from my extraPaths it became resolvable again. It seems that you have to decide whether to have a directory as an extraPath or a resolvable package. Sorry for the mix-up, in python both are allowable.
jakebailey commentedon Jun 17, 2019
Interesting, I figured we'd allow both. Do you mean you had something like:
And added
mod_teststoextraPathsto doimport a.b, but also wantimport mod_tests.a.bto work?jaredcm commentedon Jun 17, 2019
That is exactly what I was looking for. I wanted to keep general utility functions in mod_tests and also have the ability to import sub_tests directly as sort of plugins.
astrowonk commentedon Jun 18, 2019
Hmm, I still have an issue. My workspace is like this:
with all folder1 -> folder3 added to my python path with .pth files for each. I also added all of them to the extra paths settings. They all show up as part of "user search paths" in the python log.
I also added to my workspace another folder, let's call it "astrowonk_code" which has other python files I want to be able to import from jupyter (thus why it has .pth file pointing to it)
Nothing in astrowonk_code is getting analyzed. the path shows up in "interpreter paths" but the outlines aren't getting created nor are any float over definitions working.
But astrowonk_code does get partially analyzed if I put it also in
extra_paths(though the python log still shows it only under "interpreter search paths.") except it still shows "Analysis in progress.." over every definition tool tip. eventually there is just nothing when floating over functions. (The outline sometimes gets made? seems inconsistent.)So most of my code the analysis is working properly, but not all. Looks like I'm on 0.3.15.0 of the LS.
(also the endless analysis still happens if I don't add folder1-3 into extrapaths. If
autocomplete.extrapathsis unset, Code Analysis in Progress lasts forever, even if all the paths I would add to extrapaths show up in "interpreter search paths"if I add astrowonk_code to the
extrapathsthen it still only appears in interpreter paths, but folder1-3 now appear in both. ¯_(ツ)_/¯jakebailey commentedon Jun 18, 2019
We only consider code within the workspace to be user code. Everything specified in
extraPathsis split into what is and isn't in the workspace, then placed accordingly. My impression was thatmy_codewas your workspace, soastrowonk_codeis outside of it.If it's library code, then many features will not operate within the module, though the outline should always appear (symbol collection is separate).
As for the hang, it's a bit difficult for me to make any judgement without seeing the trace log output, specifically the path list. The issue I had fixed was that the whole workspace was being marked as "interpreter", so I'd need another example that I can run that would have the hang.
jlumbroso commentedon Jun 20, 2019
Jake Bailey (@jakebailey) I am on macOS, running
I am using a virtual environment, with a Mac Ports interpreter. I keep experiencing the same problem, and a perpetual "Code Analysis in Progress..." What's the right information to report to be helpful?
I looked for
.pthfiles (which I did not know of previously) and realized that some packages in my virtual environment use some:Maybe this is expected, but I guess I am surprised that this affects the server entirely, even on examples that seem wholly unrelated, such as:

I have tried to reproduce the conditions of this problem without success. Here is what I did: - I setup a blank environment with the same Pipfile (including the `mypack = {path = ".",editable = true}` line). - I created the venv with pipenv, and used it as target interpret. - I created a bogus `mypack` package with an empty `__init__.py` file. - I created the `example.py` file above. This time the code analysis worked.I am not sure, besides the actual content of the code in
mypackwhat is missing from the above protocol compared to my original context.By the way, I followed the instructions here to reinstall the most recent version and got the same above reinstalled, making me wonder if I should use the beta version:
The
PipfileI was considering today was:Any help much appreciated!!
jlumbroso commentedon Jun 20, 2019
I am trying the beta channel, and it seems to address the current problem I was reporting.
QuantumStatic commentedon Sep 5, 2020
I am still facing this issue on 3.8.5
jlumbroso commentedon Sep 5, 2020
Utkarsh Jain (@QuantumStatic) Same, actually, although I love VS Code, I ended up just switching to PyCharm for all Python-only projects, which seems (for now) to have a more reliable, consistent Python intelligent support in my experience: https://www.jetbrains.com/pycharm/
QuantumStatic commentedon Sep 6, 2020
Jérémie "Sonnet 4.5" Lumbroso (@jlumbroso) There is much customisations available but, if they don't fix it I'll have to shift 😔. I did start a new issue hoping it to get some traction.
jakebailey commentedon Sep 14, 2020
We are not as actively maintaining this project as we have previously; you're advised to try out Pylance, which we are actively developing: https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance #2096
QuantumStatic commentedon Sep 22, 2020
Yes I downloaded Pylance I really liked it. There are some syntax highlighting issues but nonetheless, it's great.