spyder: Editor autocompletion and help extraction not working in Spyder 3.1.4
I have updated Spyder (pip install -U spyder) to 3.1.4 and the autocompletion in the editor stopped working. In the IPython console it’s still working, but not in the editor.
Please provide any additional information below
- Spyder Version: 3.1.4
- Python Version: 3.5.3 32-bit
- Qt Version: 5.8.0
- PyQt Version: 5.8.1
- Operating system: Windows 7
Dependencies
jedi >=0.9.0 : 0.10.2 (OK) matplotlib >=1.0 : 2.0.0 (OK) nbconvert >=4.0 : 5.1.1 (OK) numpy >=1.7 : 1.11.3 (OK) pandas >=0.13.1 : 0.19.2 (OK) pep8 >=0.6 : 1.7.0 (OK) pyflakes >=0.6.0 : 1.5.0 (OK) pygments >=2.0 : 2.2.0 (OK) pylint >=0.25 : 1.7.1 (OK) qtconsole >=4.2.0: 4.3.0 (OK) rope >=0.9.4 : 0.9.4-1 (OK) sphinx >=0.6.6 : 1.5.5 (OK) sympy >=0.7.3 : None (NOK)
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Reactions: 5
- Comments: 115 (46 by maintainers)
After some extensive testing with various versions of Spyder, WinPython, Anaconda, python and Jedi (testing on Win7 x64), I think I found where the problem is: It happens only because of opening/creating any “Spyder project” with Spyder versions >=3.1.4 . I hope that below notes will be helpful in fixing the bug.
This happens the same in Anaconda (tested 4.4.0, 4.3.0) and WinPython (tested with latest stable and beta versions), Python 3.5 & 3.6 and jedi versions.
***For Spyder version >= 3.1.4 It happens only when editing files which are within in a Spyder project or when/after a Spyder project is opened (it doesn’t depend on the version of the jedi). I observed below cases:
***For Spyder version 3.1.3 (probably with the lower versions as well), I haven’t observed this problem. Note that I tested both Jedi 0.9.0 and 0.10.2, and this problem did not happen, although Spyder warns that version 0.10.2 is not okay (NOK).
I have also noticed some slow down for several seconds (maybe 5 secs) when “import module”+Tab is pressed for the first time, but after the first attempt, the successive attempts work fast. I suppose jedi puts it into a cache or something like this. This slow down doesn’t happen all the time though, and maybe related to the observations reported by @stonebig
I re-updated the Spyder to the 3.1.4 version. But the autocompletion didn’t work again in the editor (nothing showed up after waiting for about almost 1 minute).
Then I re-downgraded the Spyder to 3.0.2, and it worked again. The code-completion showed up immediately after I typed “numpy.” or pressed short-cut. Next, I tested spyder 3.1.0 and 3.1.2. They worked as well as 3.0.2.
When I tested spyder 3.1.3. A missing dependency error message showed as follows: jedi =0.9.0: 0.10.2 (NOK) I ignored the error message, and the autocompletion still worked.
Finally, I updated spyder to 3.1.4 again, and the autocompletion didn’t work.
The tests were run on a windows 7 x64 PC. Used the spyder 3 for Python 3.5 installed through conda. Haven’t tested other environments.
Hope these help!
Some more information about my environment:
Python 3.5.2 :: Anaconda custom (64-bit)
jedi >=0.9.0 : 0.10.2 matplotlib >=1.0 : 2.0.0 nbconvert >=4.0 : 4.2.0 numpy >=1.7 : 1.11.3 pandas >=0.13.1 : 0.19.2 pep8 >=0.6 : 1.7.0 pyflakes >=0.6.0 : 1.5.0 pygments >=2.0 : 2.1.3 pylint >=0.25 : 1.6.4 qtconsole >=4.2.0: 4.2.1 rope >=0.9.4 : 0.9.4 sphinx >=0.6.6 : 1.5.1 sympy >=0.7.3 : 1.0
Ok, after several restarts of Spyder, it’s seems like it’s working sometimes but not always. Kind of hard to say when it’s working and when not.
I will update the issue as soon as I can see some pattern.
I hope the massive irony of ‘trusted repo’ and ‘
pip install’ has not escaped you?After setting PYTHONPATH environment variable it started working
To @sschuldenzucker:
Thanks.
Please read this:
https://mikemcquaid.com/2018/03/19/open-source-maintainers-owe-you-nothing/
We try to do our best to support Spyder users, but you need to be aware that there’s no company behind Spyder. Anaconda distributes it but they don’t pay us to develop it. And Quansight supports me now to work part time on it, but Spyder is one of many projects they support and Quansight can continue functioning if Spyder would disappear (which is not true for Mathworks in case Matlab would fail as a product).
So we work on Spyder because we really want an IDE like it to do scientific computing. That other people can benefit from our work is great and really rewarding, but we don’t have any legal nor any other kind of obligation to support it.
Sorry but this is not our fault. Your company’s IT simply don’t understand how open source software (OSS) works. They can’t treat OSS as commercial products because OSS is evolving constantly (introducing new features and solving old bugs all the time).
This bug was fixed in Spyder 3.2.2 (released in September/2017, i.e. 9 months ago). If you can’t update then it’s really, really not our problem.
Yes, please avoid comments like this in the future, not only here but on any other OSS you use. They are one of the most demotivating things for us developers and maintainers of OSS projects, that mostly contribute our expertise, time and efforts out of good will.
Interestingly I noticed the following - even after I got my problem fixed after uninstalling enum34 package, it comes back again after my MacBook goes into a sleep mode. Afterwards only a restart of Spyder helps. I’ve also tried the workaround described by @minzastro, but it didn’t solve the issue.
The workaround itself is the following: "Interestingly, changing spyder/utils/help/conf.py seems to solve the problem:
#html_use_smartypants = False # I commented out this smart_quotes=False # and added that
I run on jedi 0.10.2, will test for jedi 0.11 later."
Windows : Right click computer -> Properties -> Advanced system settings -> Environment Variables -> New Then add PYTHONPATH variable with value of your python location (i.e C:\Python). I added to both user and system variables to make sure it is available in both env.
— Update ---- It was broken again (somehow) on my laptop . It seems working after updating to Spyder 3.2.5
pip install -U spyder
I can’t reproduce this in an Anaconda environment with all packages up to date. There was a problem with the Jedi conda package (one of our completion libraries) but it was solved on Sunday, so people using Anaconda please update Jedi with
I also tested this with all pip packages (inside a conda env because I can’t do it otherwise, but the env only provides Python and pip as base packages) and everything is fine there too.
So I don’t know what happens in your case, sorry.
@DiegoF90, that list is in our Readme for our main dependencies:
https://github.com/spyder-ide/spyder/blob/3.x/README.md
However, each of these packages brings their own dependencies. So, in total, Spyder depends on ~90 packages (last time I checked).
It’s
spyder-kernels, notspyder-kernel.Here’s a thought…remove conda update --all option ??? Just sayin’
On Oct 7, 2018 8:04 PM, “Carlos Cordoba” notifications@github.com wrote:
It’s probably my fault for using conda-forge?
No, it’s not conda-forge. it’s conda update --all, which you need to stop using because it breaks the restrictions imposed by some packages on others.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/spyder-ide/spyder/issues/4410#issuecomment-427711736, or mute the thread https://github.com/notifications/unsubscribe-auth/AjuRbFHhE5viITm8IZhUpdn5mC0OR5V2ks5uisDYgaJpZM4NJ7jo .
– This email and its contents are confidential. If you are not the intended recipient, please do not disclose or use the information within this email or its attachments. If you have received this email in error, please report the error to the sender by return email and delete this communication from your records.
@endolith, please stop doing
conda update --all. Instead you need to doThank you for your response, @BRdubW
To be honest, it’s sort of a “cure” for cancer (albeit somewhat easier, hopefully 😃—a good deal more complicated than it may appear on the surface. There have been many different individual proximate causes for it stopping working (why is exactly why there have been
and furthermore,
because, just like cancer, it isn’t a monolithic “disease” with a single treatment effective for all types, and given the fact that, like cancer, the root commonality being at such a low level it cannot be totally cured for all except by a very fundamental overhaul to the architecture of its host. This is far more ambitious than just trying to find band-aid treatments to the individual manifestations of the problem, and requires a lot of development time and commitments that as a volunteer project we don’t necessarily have in abundance, and that face much more inertia than the former. Furthermore, with regard to
the same underlying issue affects one if it affects the other, at least when used from the Editor, but conversely, the underlying work will improve all our completion/introspection/etc/ facilities.
With regard to
Considerable work has been underway for over a year to get this fixed, but our loss of third-party funding has hampered this process. However, with our community and grant funding now in place, we’re planning to release Spyder 4 beta 1 on
conda-forge, PyPI (?) and Github in the next few weeks with everything implemented thus far, and Spyder 4 beta 2 a couple months after which will merge the LSP improvements you’ve been waiting for. The first release canidate is planned for the end of December of this year, and the final release for Q1 2019.I use the miniconda environment and frankly that makes it easier to use Spyder without getting all the overhead of Anaconda.
On Tue, Jul 24, 2018, 21:20 Brian R. W. notifications@github.com wrote:
Same problem, Win 7, Spyder 3.1.4 with conda.
@arman00 , you just saved my day! Was desparate until I saw your comment: This solved the issue, it was all about being in a project. Thank you so much!
I had also tried the tricks around PYTHONPATH above, with no effect.
@anyone: Is it possible to “pin” these workarounds or so, so others with the same issue can find them more easily?
<rant>This was really frustrating to me because it rendered such a beautiful and amazing piece of software basically useless for me. No completion and no help just costs me far too much productivity. I’m sure that many others feel the same way. To make it worse, my organization has very strict IT security rules, so it’s by far not as easy as “just try to update all packages” or “just try to downgrade”: I have to explain to the IT people which version of which package specifically I need and why.You guys are doing amazing work: you empower people around the world to do their work better and more easily than they could have wished before and to achieve amazing things. But these people, like, me, now depend on you. And frankly I cannot understand how this problem could slip through before the release, then the bug was incorrectly closed and is still closed even though the issue is clearly not fixed. If you were a company, I’d say you really need to work on your quality control. So perhaps you want to go and look into your processes you do prior to releases, especially testing. Please tell me if I can be of any help.
</rant>@BRdubW, @cocoaaa, we’re sorry to hear autocompletion is not working for you or stops working after some time. Right now we’re working to improve the situation in PR #4751, by using an industry standard architecture for code completion called language server protocol (which is the same one used by the VSCode and Atom editors).
Unfortunately, that will come in Spyder 4, to be released (hopefully) in Q1 of next year. In the meantime, we have to apologize for the inconveniences this is causing you, but there’s little we can do to make the situation better in Spyder 3.
I had the same problem on mac-high sierra-v. 10.13.4, python 3.6 and spyder 3.2.8. Here is what I did to solve it as also mentioned by @halidziya: 1- click on “python” from the toolbox menu on the top 2- click on “PYTHONPATH manager” 3- click on “Add path” 4- navigate to your environment’s bin folder (for example: /Users/“username”/anaconda3/envs/“env name”/bin) 5- click “open” and you’re done!
@cocoaaa, hopefully tomorrow.
@halidziya Can you describe step-by-step please what exactly you did to solve this issue? Thanks!
@dalthviz is working to fix this in 3.2.1. Thanks for your patience.
I working with anaconda3 and Spyder 3.2 on WindowsX64 and have exactly all the Problems described by @arman00 above. Autocompletition seemed to work fine in the previous Version of Spyder.
IPython >=4.0 : 5.1.0 (OK) cython >=0.21 : 0.25.2 (OK) jedi >=0.9.0 : 0.10.2 (OK) nbconvert >=4.0 : 4.2.0 (OK) numpy >=1.7 : 1.11.3 (OK) pandas >=0.13.1 : 0.19.2 (OK) pycodestyle >=2.3: 2.3.1 (OK) pyflakes >=0.6.0 : 1.5.0 (OK) pygments >=2.0 : 2.1.3 (OK) pylint >=0.25 : 1.6.4 (OK) qtconsole >=4.2.0: 4.3.0 (OK) rope >=0.9.4 : 0.9.4-1 (OK) sphinx >=0.6.6 : 1.5.1 (OK) sympy >=0.7.3 : 1.0 (OK)
I am not sure if this fix has already been included in the 3.2 release, but I have noticed a case where it doesn’t work with 3.2 and another case where it works.
In a file opened in the editor where I import both a standard Python module and another script as a module from a different path
Thanks,
@arman00, thanks a lot for your thorough investigation and for narrowing down the problem.
@dalthviz, please start to work on this problem to see if you can find its root cause. I think it could have been caused by PR #4263.
Facing same issue, freshly installed Annaconda 4.4.0, python settings reset, running on Win7 64bit.
PS: after restarting spyder (2-3 times) autocomplete and help started to work in editor…
I had used VSC for a while until I needed to do some exploratory work and changed back to Spyder. I have done nothing but reopen it, but the code completion miraculously comes back! I swear I have reopened and even reinstalled it for plenty of times yesterday, and have done nothing related to spyder even since I gave up.
But it works now. O.o
@dalthviz, please take a look at this one. Notice that the OP has Jedi 0.10.2 installed.