Closed Khris777 closed 4 years ago
I have been using Spyder normally today for about 3 hours now. The error didn't reappear and I didn't have to rely on that workaround I described above so far.
Sadly I have no clue what caused that error as it appeared rather randomly, I can't reproduce it. It's possible that switching from working with one file to another makes it more probable to occur, but that's speculation now.
I think this is caused by the server crashing at some point in the background. Therefore, I'll add a menu entry so that users can manually restart the server in case that happens.
@Khris777, that's equivalent to the workaround you mentioned and it'll be available in our next version.
I am using Spyder 4.0 (conda install) and all autocomplete and code navigation "crashes" all the time. Although I see no error, it just stops working. I found a nice way to reproduce it in my code, but not as a snippet. My code is a python file which includes many packages and has functions in it. This is tested inside one of the functions. But as Spyder crashes all the time, I guess this is not specific to my large project:
After closing Spyder and launching again all is fine. I suspect that the the issue might be related with parsing a larger project + fast user actions. I have noticed that I've also been hitting Esc to suppress some completion and typed myself fast. So perhaps it just crashes when not being able to handle typing speed combined with complex code and possible syntax errors. As I said, doing exactly the same thing in a vanilla python file does not crash Spyder. If there is a way to log what happens, I am happy to reproduce and log :)
Edit: my system is Python 3.6.9 on Ubuntu 18.04
@martinrebane, please post an animated gif of the situation you described above because I don't understand it very well.
@ccordoba12 Yes, I made a screencast. While recording I saw that it is even more simple than that. Now I got it crashed just be producing syntax error while typing. Here is the screen recording: https://youtu.be/GY_1hR5l8rc
print
statement. I am also hitting ctrl+space there, nothing happens.Please let me know if I can help any further!
Just in case, here are my settings for code completion:
While I had crashes last week, since monday I didn't have a single crash or problem anymore.
No idea why it's gone now.
I have the same problem constantly. Mine does not go away. Only fix is to restart Spyder.
Same problem here as described in OP. I also have the same problem that @martinrebane describes, except I'm not working on any large/complex projects. Restarting Spyder fixes the issue for a short while. Sometimes its only minutes before the issue is back. Have tried resetting Spyder. I have not been able to see anything in logs/internal console - but I'd be happy to assist more if I can.
Spyder 4.0.0 Python 3.7.5 64-bit | Qt 5.12.5 | PyQt5 5.12.3 | Windows 10
Just to add another - linter gets "stuck" thinking a variable is never used, even after it is, and even after its definition is commented entirely (which should yield a red marker): lint_demo.mp4 (note: using UTF-8 encoding)
Circumventable by cutting out a few lines above and below the offending one, and pasting back
Version 4.0.1, but still happens to me too - seemingly every single time I use Spyder. No idea how to produce it on purpose, other than just coding away for a while. Only fix I have found so far is to restart Spyder.
I saw issue #11501 and #11500 which I guess are the same as this issue or at least related.
Running Spyder with "--debug-info verbose" I get a different error (EOFError vs. ValueError) than #11501. Also with this level of debug enabled it appears the language server restarts. So code completion, linting, go to definition etc keeps working but continues to crash repeatedly when trying to code-complete. Same behavior with and without Kite enabled.
Running Spyder without debug it seems the language server just crashes and doesn't restart, as is described in the rest of this thread.
Edit: Spyder 4.0.1
@rhkarls, please open the Anaconda prompt and run there
conda install parso=0.5.2
That should fix your problem.
@rhkarls, please open the Anaconda prompt and run there
conda install parso=0.5.2
That should fix your problem.
Cheers @ccordoba12 ! I was already running with parso 0.5.2. I tried upgrading to 0.6, and I got the same ValueError as reported in #11501. I downgraded again to 0.5.2 and it appears to work now - at least it doesn't crash straight away. A lot of other packages were also down/upgraded in the process by conda, including jedi, the language server and spyder+kernels.
Glad to hear it was solved!
To note, I verified time and again that the more the total lines of code in all files opened, the sooner the linter's functionality degrades - worst-case, immediately
@OverLordGoldDragon, please don't start to comment in unrelated issues about your errors. Thanks!
@ccordoba12 How's it unrelated? It's about linter not working after a while, just as the linked issue - I'm just adding information to a more active thread.
Sorry, I thought you were posting on a different issue.
Hi @ccordoba12
I have a similar problem. I updated to spyder 4 and now the right-click "Go to definition" doesn't work anymore. I have windows 10 and Anaconda environment. I also tried putting my project directory in the PYTHONPATH manager and it still doesn't work. Is there a solution for this issue? My project files are big and not having this feature is making it impossible to work. Any help would be greatly appreciated. Do I need to uninstall and re-install spyder 4?
I tried the solution mentioned above but it seems that parso is already installed for me. See below. How do I check the version of parso installed? And can I simply conda uninstall parso
and then again conda install parso=0.5.2
? Thanks for your help!
Collecting package metadata (current_repodata.json): done
Solving environment: done
# All requested packages already installed.```
I tried the solution mentioned above but it seems that parso is already installed for me. See below. How do I check the version of parso installed? And can I simply
conda uninstall parso
and then againconda install parso=0.5.2
?
conda list parso
to see the version, or in a python console import parso
followed by parso.__version__
Try the commands you suggested. What worked for me, for some unexplained reason, was to install parso 0.6.0 and then downgrade to 0.5.2.
@rhkarls Thanks for the tips. I checked my parso version and indeed it was 0.5.2. So I tried to upgrade it first. So I ran conda update parso
. And in the prompt it said that it would automatically downgrade spyder to 3.3.6. I accepted it and it works now. Today morning I had done conda update --all
to fix some issues with pyTorch and torchvision installs. And didn;t realize that spyder got updated to 4.0.1.
Strangely enough, parso was upgraded to 0.6.1 and spyder to 3.3.6...automatically without even me forcing it so. But now with the downgrade of the spyder it all works. I'll keep it that way until perhaps the issues with spyder 4.0.1 are resolved. Thanks again for your timely response!! Much appreciated.
just upgraded to spyder 4.1.1, windows 10 64b
it crashes every hour or so with this "completion and linting in the editor for python files will not work ", suspect it is due to the integration with kite
suspect it is due to the integration with kite
No, it's not.
I'm also experiencing this issue. It's quite annoying as I have to run specific parts of my code again each time I restart, to load the example data I need to continue coding.
I have tried all the above solutions and none of them have worked so far. It just keeps crashing whenever I use Spyder 4.
Is there any update/solution in sight?
I am still getting spyder crashes every hour or so due to this problem, I did what @matheger suggested and started spyder in debug mode spyder --debug-info verbose: now I get this on the issue reporter
I am still getting spyder crashes every hour or so due to this problem
Is that a hard crash (i.e. Spyder closes immediately)? Or does Spyder show the "Completion and linting stop working" message and open the issue reporter?
Try running Spyder with
--debug-info verbose
. It will nag you with crash report windows instead of just rolling over and dying.If you also add
--debug-output file
, it will create a log file somewhere in your personal folder. Might be useful for tracking this further.
Thank you. But how exactly do I do that?
Thank you. But how exactly do I do that?
I've edited my post above with a howto. Hope it helps!
@ccordoba12
Is that a hard crash (i.e. Spyder closes immediately)? Or does Spyder show the "Completion and linting stop working" message and open the issue reporter?
if I am not in debug mode, I get the error and every time I try to write something the message pops up again , so I have to shutdown spyder and restart
if I am on debug mode the error report pops up and I can close it and continue
I also have this issue since upgrading to Spyder 4.1.1 Unluckily I cannot reproduce the error by doing something specific. It just happens after around 10 to 20 minutes of coding.
I hope this gets resolved. This is getting a little intolerable that I have to restart spyder after hours of coding.
We are working on this to improve the current UI and also add the possibility of restarting the language server manually. The new release should be available next week.
Adding to all of this, apart from often simply stopping to work without notice, sometimes it stops with that error message, and it will then spam the error message on every single keystroke.
Just saving my file provokes the error message to appear twice, so it becomes impossible to work and only a restart helps.
We are working on this to improve the current UI and also add the possibility of restarting the language server manually. The new release should be available next week.
Thanks for your efforts in sorting this out. The new linting and completion mechanisms will definitely be a step up when working properly. In the meantime is it possible to implement an option to use the old linter in Spyder 4 so that we can benefit from the other great features? I've found that linting fails after just a couple of minutes with just one relatively small file open. It sounds like the fixes you're working on won't solve the root problem and manually restarting the language server isn't going to be viable if it falls over every couple of minutes. I think if people can use the old linter it gives you more time to figure out all the issues.
Also thanks from my side! Is there any quick fix for this? When coding heavily, this error appears more frequently than every 20 minutes. Having to clear the cache/variables etc. by restarting every few minutes totally kills my efficiency at work. Is there any quick fix or a workaround by completely killing the linting? Otherwise I'll have to switch to PyCharm, which I'd like to avoid.
I just realized that my solution to start Spyder in debug mode fixed a different problem - that of random Spyder crashes - but not the one in the OP. I mistook one for the other because I never had the exact error message about linting/code completion and didn't read the description carefully enough. Today is the first time I ever saw it in person. I deleted my post above to not lead future readers astray.
The fix has been made and a new version coming next week. Thanks for the help debugging and your patience.
The fix has been made and a new version coming next week. Thanks for the help debugging and your patience.
Thanks a lot @goanpeca and @ccordoba12 !
To those interested in our solution, we've done the following to improve this annoying situation:
Add an option to never show the intrusive message again.
Add a mechanism that tries to detect if the server went down and tries to automatically restart it.
Add a new entry to the status bar that shows the status of the server (starting, ready, restarting or down) and a menu entry that allows to restart it manually:
While those features may help, they seem to be only remedial to recover from the aftermath of the error. Do you have any idea yet why it happens in the first place?
While those features may help, they seem to be only remedial to recover from the aftermath of the error
Hopefully things will go unnoticed from now on when the server stops working for most users, because it'll be restarted by Spyder automatically.
Do you have any idea yet why it happens in the first place?
We're still investigating the issue.
Fair enough. Fingers crossed! Looking forward to the next update.
regarding the fix for next week that automatically restarts the server: what happens to the workspace ? the variables that are in memory? will these values be lost?
Hope not, since that would mean restarting work every hour or so
regarding the fix for next week that automatically restarts the server: what happens to the workspace ? the variables that are in memory? will these values be lost?
Hope not, since that would mean restarting work every hour or so
I suspect not. There is a workaround (going into preferences, completion and linting, advanced, select 'use stdio pipes', apply, deselect use stdio pipes' again and apply) which effectively does the same (restarting the server), which has always worked for me so far and does not do anything to the workspace, variables, etc.
what happens to the workspace ? the variables that are in memory? will these values be lost?
@ricmarchao, the restart is done in place, so you don't need to restart Spyder and lose your work.
To those interested in our solution, we've done the following to improve this annoying situation:
- Add an option to never show the intrusive message again.
- Add a mechanism that tries to detect if the server went down and tries to automatically restart it.
- Add a new entry to the status bar that shows the status of the server (starting, ready, restarting or down) and a menu entry that allows to restart it manually:
How to get that option?
It'll be available in our 4.1.2 version, to be released in a couple of days.
Glad to know that and thanks for your effort.
While those features may help, they seem to be only remedial to recover from the aftermath of the error
Hopefully things will go unnoticed from now on when the server stops working for most users, because it'll be restarted by Spyder automatically.
Do you have any idea yet why it happens in the first place?
We're still investigating the issue.
Thanks for doing this. As a user though I do feel Spyder is getting quite slow and slightly delayed to work with, even with just typing code for example. Responsiveness in the program is really important and these kind of constant checks and workarounds can impact reliability of the program. Though I love Spyder, I am seriously close to changing IDE's as a result of the constant interruptions with this error, crashes and instability. Hope a true fix rather than workaround can be found? Even getting a dialog every 20 minutes is extremely annoying when you are trying to focus. At least the variable memory will not be erased due to program crash. Happy to help with anything. Cheers Peter
After working for a while in Spyder at some point several functions just stop working:
Often there is no error message, sometimes there is one that tells me that code completion and linting will not work in the current session or have stopped working. It tells me to make sure that my firewall or antivirus allow Python processes to open ports on my system or to restart Spyder.
I'm working at a company behind a company firewall with an Antivirus Software.
My question is now:
EDIT 1: I played around with the advanced settings. In the end I enabled the usage of STDIO-Pipes and started Spyder with that option enabled. Performance was worse and the error also happened after a while, so I switched the option off and continued working. Apparently this restarted the language server and since then (about an hour ago) it has been running without fail. This makes it look more like the issue is not with my system's firewall or antivirus but some internal Spyder issue, maybe something that happens at startup?
EDIT 2: After about 4 hours the error happend again. I did what I did above, go into the settings, activate STDIO-Pipes, then deactivate it again, now the server is running again normally.
Versions
Dependencies