-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spyder's help and code completion features stop working after resuming from extended sleep #5613
Comments
Thanks for reporting. This will (probably) be solved when we merge a new architecture to provide code completions and help, which is being worked out in PR #4751. However, that work will be part of Spyder 4, to be released next year. There's nothing we can do for Spyder 3 though. |
Thanks for the update. Looking forward to Spyder 4! |
For reference, I believe I am experiencing the same problem after sleep on Windows 10 Enterprise x64 with 3.2.3 - 3.2.4; as I put the machine to sleep in the middle of spyder sessions, and later come back (often much later) and completion, help etc. often mysteriously has stoped working in the editor but not the console. Therefore, it appears to be a cross platform issue. |
Also, I can confirm this also happens anytime I lock my screen, i.e. as I'm supposed to whenever I step away from my machine, which essentially means I need to restart spyder every time I do so or miss out on help, completion, introspection, etc....obviously, a pretty large hit to productivity. So, to confirm, there isn't any easy-ish way to patch/mitigate this bug without completely reworking the whole completion/introspection architecture—it isn't just some timeout or something somewhere? If not, is there anything short of a full Spyder close and relaunch that would serve to get it working again? If so, maybe we could implement an internal console command or GUI button somewhere to restart |
I can't reproduce it on Linux, so I don't know how to fix it. You can start Spyder with debug facilities turned on by running
and then starting Spyder from the command line to better understand what happens. |
Okay, thanks much. I'll try to take a look a little later this week after I work on the FAQ, etc. |
This should be fixed by our new code completion architecture. |
@ccordoba12 is this new architecture in a current release? If so I can update and report if the issue is gone. |
@trianta2, it'll be part of Spyder 4 and it'll be part of our beta2 version, to be released in a couple of weeks. If you don't want to install our beta, you'll have to wait until January for the final version. In any case, you're welcome to report back. |
@trianta2 You can also test it now by cloning this Github repo, making an Anaconda environment with the right dependencies (in the |
this is still happening with spyder 3.3.1 on windows 7 |
@venkatgmrit05 Please read @ccordoba12 's comment right above yours. As a quick update, we've delayed the release of Beta 2 to December to conduct additional testing on various OSes to make sure the new architecture is indeed much more stable and doesn't have these issues. Of course, we'd welcome your help in testing it once it is released, so we can iron out any remaining issues. Thanks. |
gotcha! thank you,. looking forward to it :) |
I am also having this problem macos 10.14.6. Spyder opened through anaconda. Any solution so far? |
This is probably going to be fixed in Spyder 4, to be released in a month or so. |
Thanks! |
@mxardre As @ccordoba12 said, this has mostly been fixed in Spyder 4, of which 7 betas have already been released and the next release AFAIK should be the release candidate build, the final stage before a release. You can try out the betas now to see if it resolves the issue, and track the real-time progress of the release with the 4.0rc and the 4.0.0 final milestones. |
So when will this be patched in the non-beta spyder? This is a rather small, but very inconvenient bug. |
@Travis-Barton It already is as of a few days ago, as Spyder 4.0.0rc1 has been released, which is labelled a release candidate rather than a beta (as a clarification, what the Spyder team has referred to as betas are usually termed alphas since they add major features, and the release candidate is what would more typically be called a final beta since a followup final release was always planned, but to be clear that is not a negative judgement on their quality/stability and I've used the betas as my daily driver for the past year since Spyder 4 beta 2 and they are relatively stable now). Spyder 4.0.0 final should be out very soon; you can track the progress toward the same in by following the relevant milestone on Github. |
Taking a look at the release notes I see several quality of life features that I am exited about! I can't wait to start using it! |
In case this is not understood yet and new anecdotal observations add to the clues: I seem to have this problem (autocomplete stops working, in Editor but not IPython, after putting Win10 to sleep) To confirm, after Win10 sleep: Please let me know if more details would help. |
Thanks for the detailed information! Its quite likely a different issue since the completion infrastructure is almost completely redone from what was there before, particularly the parts that OS sleep is likely to affect. However, that's a potentially very interesting result, if a Spyder change really did prompt completion to stop working in this scenario. However, I was not able to reproduce this behavior on either my clean Win 10 1909 test box running Spyder 4.1.3, with clean prefs and a clean slate of the latest Spyder dependencies installed (most notably Spyder-Kernels 1.9.1, Jedi 0.15.2, Python-Language-Server 0.31.10, Rope 0.17.0, Parso 0.5.2, nor on either Spyder 4.1.2 or Spyder 4.1.3 on my primary Win 8.1 machine under the same deps, both under Python 3.7. In all cases, after short or long (multi-minute) sleep, completion, help and other LSP services worked from the Editor as expected. If you can provide a complete |
I wonder if there is any relation to #12259. Currently, Jedi 0.15.2 does not use a clean environment when launched, and while this may only affect non-conda environments, I'm curious to know whether system variables are changed over some period of time by the system, then, if the LSP (and Jedi) are ever restarted (as can happen normally) an offending variable is picked up by Jedi causing unstable behavior. Just an outlandish theory... |
@CAM-Gerlach Sorry i also have this issue now on 4.1.2 after sleeping Win10.1809 overnight (multi-hour). ctrl+I seems to stop working at the same time, but not 100% sure yet. Will confirm. Both Spyder installs (4.1.2 and 4.1.3) are from Anaconda 1.9.12, Conda 4.8.3. No Pip use at all on these envs. Full conda list (the only diff is spyder 4.1.2 and 4.1.3, ie all other packages identical versions): alabaster 0.7.12 py37_0 |
@ccordoba12 I'm not a coder by trade so i'm not sure of the normal way to do that. My hack is to just edit that file with that one line of code change. I've done that and restarted Spyder fine. Will have to get back to you when Win has been in a long sleep, probably <24 hours. Hope that's ok. |
That's fine.
Ok, thanks for your help! |
@ccordoba12 After patch #12771 then first long sleep: All good (Editor completion and ctrl+I). |
@ccordoba12 About an hour later, without an OS sleep, completion has stopped working. I cannot be exactly sure when that was triggered but at the same time i noticed another problem which i had not before. I added one line near the top of the code so all the functions were pushed down one line. The little triangles next to the line numbers which allow you to collapse (fold?) a function did not move with the function and were still trying to operate on the now empty lines. Is this related to Linter? |
@JonB451 , does restarting the LSP server from the statusbar return proper functionality? |
Sorry to hear that. It was confirmed by another user (and me), that #12771 fixes this problem on Windows, so I don't know what else could be happening.
Yeah, linting and folding depend on the same server, so if one dies, the other dies too. |
I would guess that whatever followup issue issue @JonB451 just reported is not directly related to this one, then, given that the behavior is different? |
@JonB451 That would also be a more than acceptable workaround. Could you explain to me how to restart the LSP server from the status bar? Does this require Kite to be installed? Thanks. |
Hi @quamobrem I don't have Kite installed. In the status bar at the bottom of Spyder, amongst other statuses, is the "LSP Python" status. If you click on it then a pop up gives you the option to "Restart Python Language Server". That's it :-) Hope it works for you. |
Closing because a problem like this hasn't been reported in a long time. |
Description of your problem
I've been experiencing this problem with Spyder for several months (maybe even years) on OSX, across multiple different machines. Currently I'm using macOS Sierra 10.12.6.
If I sleep my mac for an extended period of time with Spyder open, the help (CMD+i) and code completion features in the editor will stop working, however from within the iPython console they will continue to work.
This is difficult to reproduce, but eventually always happens. A short sleep will not cause the problem, nor will a sleep long enough to prompt a re-login.
What steps will reproduce the problem?
What is the expected output? What do you see instead?
Help and code completion features in the Spyder editor are disabled.
Please provide any additional information below
Versions and main components
Dependencies
Please go to the menu entry
Help > Optional Dependencies
(orHelp > Dependencies
), press the buttonCopy to clipboard
and paste the contents below:
IPython >=4.0 : 6.2.1 (OK)
cython >=0.21 : None (NOK)
jedi >=0.9.0 : 0.11.0 (OK)
nbconvert >=4.0 : 5.3.1 (OK)
numpy >=1.7 : 1.11.3 (OK)
pandas >=0.13.1 : 0.19.2 (OK)
psutil >=0.3 : 5.3.1 (OK)
pycodestyle >=2.3: 2.3.1 (OK)
pyflakes >=0.6.0 : 1.6.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.7.4 (OK)
qtconsole >=4.2.0: 4.3.1 (OK)
rope >=0.9.4 : 0.10.7 (OK)
sphinx >=0.6.6 : 1.6.4 (OK)
sympy >=0.7.3 : None (NOK)
The text was updated successfully, but these errors were encountered: