Spyder: Automatic Help/Documentation with Ctrl+I is broken in the Editor

Created on 4 Oct 2017  路  53Comments  路  Source: spyder-ide/spyder

Pressing Control+I does not bring up any documentation from the Editor

What steps will reproduce the problem?

  1. Launch spyder
  2. Create a new file in the editor, type some valid code in it
  3. Place cursor in a method call or object name that you want to get documentation for
  4. Press Ctrl+I
  5. Be sad when nothing happens

I tried the following code in the Editor:

list()
import matplotlib.pyplot as plt
plt.figure()

Hitting Ctrl+I with my cursor in the list or plt.figure() calls didn't bring up the documentation.

Typing list in the iPython console and hitting Ctrl+I works properly, it's just the Editor that has the issue.

What is the expected output? What do you see instead?
The Help pane should show the documentation associated with the variable that the cursor is in, such as matplotlib.pyplot.figure, in the example above.

Rather than showing the documentation, the Help pane goes blank (so we do see that some sort of action was triggered).

Please provide any additional information below
I have used this feature before, but it stopped working a few point releases ago.

To test this and be sure I hadn't screwed anything up in my setup, I created a new conda environment with spyder in it via:

conda create -n spyder-test spyder

Then I activated the new environment and launched spyder.

Version and main components

  • Spyder Version: 3.2.3
  • Python Version: 3.6.2
  • Qt Versions: 5.6.2, PyQt5 5.6 on Windows

Dependencies

pyflakes >=0.6.0 :  1.5.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :  2.2.0 (OK)
pandas >=0.13.1  :  0.20.3 (OK)
numpy >=1.7      :  1.13.1 (OK)
sphinx >=0.6.6   :  1.6.3 (OK)
rope >=0.9.4     :  0.10.5 (OK)
jedi >=0.9.0     :  0.10.2 (OK)
nbconvert >=4.0  :  5.3.1 (OK)
sympy >=0.7.3    :  1.1.1 (OK)
cython >=0.21    :  0.26.1 (OK)
qtconsole >=4.2.0:  4.3.1 (OK)
IPython >=4.0    :  6.1.0 (OK)
pylint >=0.25    :  1.7.2 (OK)

Editor Help

Most helpful comment

Resetting the keyboard shortcuts didn't work. Deleting my ~/.spyder-py3 directory and restarting Spyder did fix the problem.

Thanks.

All 53 comments

This should be working as expected. @dalthviz, can you reproduce this one?

@ccordoba12 I tried and it works for me:

help1

@joshburnett could you try to reset the Spyder preferences for keyboard shortcuts and see if that helps?

Resetting the keyboard shortcuts didn't work. Deleting my ~/.spyder-py3 directory and restarting Spyder did fix the problem.

Thanks.

Technically, I just renamed the preferences directory, so I still have the offending one, if anyone wants to do any further digging. I don't think that I had gone in and made any changes to that directory, so I'm not sure how the problem got in there. Just noting this, in case the problem pops up for anyone else. Hopefully there is not a problem with Spyder that corrupts some part of the preferences.

Thanks @joshburnett for your feedback and providing a way to fix this :+1:

@joshburnett, that would be really useful. Could you upload a zipped version of your settings somewhere so we can take a look at them? Thanks!

Sure. You can get the file here.

I have a similar problem, but deleting the folder with the Spyder settings don't fix the problem in my case. Nothing does besides of falling back to the version 3.1.3 (and maybe below). Anything above results in a malfunction.

I started having the problem again, and deleting my preferences folder did not solve the problem. I just did a complete uninstall, reboot, and re-install of Anaconda 5.0.0, and Spyder has the problem out of the box. I did not install anything else in the process.

I don't know if it just takes a little while for some of the relevant source code to be parsed for the first time, but when I went back immediately after submitting this, Ctrl+I worked.

To test this, I then pulled up some code that I hadn't looked at yet since reinstalling Anaconda and tried to pull up the Help for seaborn.boxplot(), and it initially didn't work. I tried again maybe 10 seconds later, and it worked.

To be clear, this is not the behavior I was seeing before I did the total reinstall. I was trying to pull up the Help for the same functions, which I routinely use, and it wasn't working, ever. Additionally, tab completion in the Editor wasn't working, and the 'Go to definition' feature was also not working. You can see why I resorted to a total reinstall.

I'll keep using Spyder and checking this feature as I make my typical preference changes. Hopefully I'll be able to track down when (if) this feature stops working. It's been quite frustrating, as it's such a helpful feature when it works.

Hi All, I'm having the same issue. Tried with the newest Spyder version and also dating back to a few previous versions, same problem. What I noticed is however, that it only happens with the rich text version of the help, the plain text works with the editor too. Does anyone have a solution already?

Exact same problem. I'm on mac os X 10.13.3, installed spyder through anaconda navigator 1.6.x (x is now 12 and I believe the install was made on something like 1.6.9, if that matters) and I also made the update (via graphical window) to spyder 3.2.4 just today (right after anaconda).
I just changed the panes and the theme (colors and typos in the prefs menu).
I also have (still do) the ndarray object of numpy module problem, if it helps.

I have the same problem with Spyder 3.3.0 and Anaconda 1.8.7. A restart of Spyder fixes the problem for some minutes but after some time the help doesn't work from editor, only from console.

@jabaa

A restart of Spyder fixes the problem for some minutes but after some time the help doesn't work from editor, only from console.

Did you try the usual fixes (e.g. spyder --reset, making sure ``enum34 is not installed, etc)? Aside from that, this sounds more like a manifestation of #5613 (which can happen to some users not only on sleep, but also on locking the screen or simply walking away for a while, etc). Unfortunately, as it involves third party packages and/or OS-specific quirks it doesn't appear a trivial fix is likely, but it (and many related issues with autocomplete/help/introspection/etc.) should be resolved in Spyder 4 beta 2 once #4751 is merged.

Anaconda 1.8.7

If you're really using a version of Anaconda that old you should upgrade, since the current version is 5.2.0 at last check. Most likely you are referring to your anaconda-navigator version, which is really just a small launcher app (incidentally, based on code originally developed by the Spyder development team), the version of which is quite inconsequential to anything Spyder-related. The version of the anaconda metapackage and stated on the download page is actually the important one, although it is reset to custom once you make individual changes to the packages it installs).

Same problem. Sometimes it works, sometimes it doesn't.
Anaconda navigator version 1.8.3, conda 4.5.11, python 3.6, spyder 3.2.6.
anaconda version 5.1.0 build py35_2

The problem could be rich text, I can see the document if I turn rich text off.

spyder 3.2.6

The current Spyder version is 3.3.1; 3.2.6 is nearly a year old by now. It might or might not fix the problem, but it certainly won't hurt, and it also greatly improves your ability to select any Python environment (Anaconda or otherwise) installed on your machine to work in while keeping your dedicated Spyder environment pristine and free of the sorts of dependency issues that are nearly always the ultimat cause of this problem. You can install it into a clean environment with conda create -n python=3 spyder, activate it, then run spyder, and then select any environment/python.exe on your machine you want to work in, so long as it has spyder-kernels installed.

If you're working in base, try updating to a consistent anaconda version, e.g. conda install anaconda=5.3 to get generally reliable versions of the relevant dependencies. Also, locking your machine or putting it to sleep can sometimes break completion/introspection/etc (which should already be fixed in Spyder 4, which use the same architecture as VSCode and Atom), so try restarting Spyder if that's the case.

Hello,

I'm having the same problem (Help works with console but not editor) with Spyder 3.3.1 with Python 2.7.15 on Windows 10. I'm using the Anaconda distro.

@sudo-robot-destroy Did you try the same solutions?

@CAM-Gerlach I re-read the thread to make sure, but it sounds like there isn't a solution yet. Maybe I missed it, is there something I should try?

@sudo-robot-destroy The ultimate solution is replacing our current completion and introspection infrastructure with a much more robust and less bespoke one, using the same Language Server Protocol architecture as used by e.g. Atom and VSCode. This is already implemented in our development codebase for Spyder 4, although stabilization and testing is ongoing to make it much more reliable; we expect to release Beta 2 with it implemented in early December.

For now, try the things I suggest previously (remove enum34 if installed, install Spyder in a fresh environment, try downgrading to the versions of jedi, parso, rope, etc. in the latest Anaconda build, spyder --reset).

Potential fix.
Try opening the Online Help pane (Ctrl + Shift + D). As soon as I opened it, my other help pane started working. Hopefully this helps you too.
Deleting my ~/.spyder-py3 directory and restarting Spyder did not fix the problem. Nor did falling back in versions. But it could have been a combination of things.

Thanks Douglas-Putnam - this worked for me today

      Potential fix.

Try opening the Online Help pane (Ctrl + Shift + D). As soon as I opened it, my other help pane started working. Hopefully this helps you too.
Deleting my ~/.spyder-py3 directory and restarting Spyder did not fix the problem. Nor did falling back in versions. But it could have been a combination of things.

hey is the correct...
var(input)name()

name = int(input('hi 'name' i am thinking of a number between 1 & 10'))

I have no ~/.spyder-py3 directory, nor the Ctrl + Shift + D solved my problem, thus I have no info pane.
Has somebody some solution?

hey is the correct...

@low-ham Sorry, but how on earth does this have anything to do with Spyder, much less the topic of this issue (the Help pane not displaying object documentation in the editor?

thus I have no info pane.

You mean the Help pane isn't appearing at all when you try to open it, e.g. from the Window > Panes submenu? This is a different issue from the one reported here (Inspect object not retrieving docstring contents)

Has somebody some solution?

Well, it depends on whether you have the same problem. This one is ultimately caused by either stability issues with our legacy inspection architecture, or problematic 3rd party dependency versions, both of which (particularly the first) should be mostly fixed in Spyder 4. In conda meantime, you can try creating a fresh conda environment with Spyder as stated in the OP and launching it from there. See our guide to working with packages and envronments with Spyder for more.

@CAM-Gerlach Thank you for your answer. I solved the issue through temporary changing Rich Text to Plain Text in the pane configuration right up. After it Inspect object got working and I was able to switch back to Rich Text again at normal working.
Finally it works now with Rich Text properly.

Strange, but glad you found a solution. Hopefully this will be mostly resolved for good in Spyder 4.

If the problem still exists,
go to tools -> preferences -> help
tick relevant boxes under automatic connections
restart python
Should solve the problem

If the problem still exists,

Thanks for trying to help, @ahmedziyad . However, it doesn't at least for whatever user you were replying to, since the most recent comment on this issue was two full months ago. Furthermore, enabling and disabling automatic connections, as you suggest, is rather unlikely to solve it if its the same problem as that originally reported here as opposed to something different or simple user error.

How to use this feature in sublime text?

How to use this feature in sublime text?

...

This is the Spyder IDE, not Sublime text.

To everybody following this issue:

Kite is a free plugin for several IDEs and editors that uses machine learning to provide better code completions for Python. We are planning to add support for Kite in Spyder, but before proceeding we'd like to know your opinion about it. Please help us with that by filling the following poll:

https://www.quiz-maker.com/poll2385657x93274cD6-68

Note: This doesn't mean that if we do that integration, code completions will only work through Kite. Spyder will give the completions provided by Kite along with the ones from other open source libraries, like Jedi and Rope.

same problem

@CAM-Gerlach Thank you for your answer. I solved the issue through temporary changing Rich Text to Plain Text in the pane configuration right up. After it Inspect object got working and I was able to switch back to Rich Text again at normal working.
Finally it works now with Rich Text properly.

This seems to be a fix, worked for me.

From ~/.spyder-py3/ folder, I've just removed onlinehelp file and restarted spyder, that's it.
Excellent everything works fine from then.

I think best semi-solution for this problem
rm -rf anaconda :)
and reinstall
everything works fine till broke

Same Issue here, none of th suggested solutions worked for me :(
any help?

@dian-ai So you are using Spyder 4.x? What _specifically_ is the issue you experience? Does Help work for only some objects, but not others? Did you try closing and re-opening Spyder?

@dian-ai Spyder v5 released it solves so well all problems.

@dian-ai So you are using Spyder 4.x? What _specifically_ is the issue you experience? Does Help work for only some objects, but not others? Did you try closing and re-opening Spyder?

@CAM-Gerlach yes I am using spyder 4, my help does not work. I have only help for numpy, the rest there is 'No documentation Available'
I did try re-starting , I did try plain text-rich text in pane, also did try If the problem still exists,
'go to tools -> preferences -> help
tick relevant boxes under automatic connections
restart python
Should solve the problem'
I did try online help, not of them worked.

@dian-ai Spyder v5 released it solves so well all problems.

@dzbyr when did it release? you are using spyder 5?

This is now a duplicate of #10671 because this issue applied to Spyder 3 and #10671 applies to Spyder 4.

@dian-ai Spyder v5 released it solves so well all problems.

I assume @dzbyr is making a satirical joke, since Spyder 5 has only just begun development though at last check it was planned to be released sometime later this year

It doesn't work for depreciated libraries.

Which libraries would that be? In any case, there's a reason they are deprecated; you should be using their modern alternatives in your current development.

@CAM-Gerlach I faced this issue with Imputer class from sklearn.preprocessing. CTRL+I doesn't work for Imputer unless selected. Works for SimpleInputer from sklearn.impute.

@shambhaviparashar If its not working only for specific classes in the Editor, then it has to do with either the documentation/structure of the package itself or the limitations of the libraries that find and extract the documentation, neither of which Spyder has any real control over, sorry. It should still work in the Console or typing in the name manually, so long as the object actually has documentation to begin with. Best of luck.

I tried (Ctrl+Shift+Space) in the Editor, then it can work now

Just one thing to make it clear, if anything is running in spyder like, You may be training thousands of images to an algorithm or somehow spyder is busy, in this case also it won't documentation for a while until spyder is free and no overhead to it.

open spyder > tools > install kite engine. >
dOWNLOAD WILL START AUTOMATICALLY
LET IT COMPLETE.. AND ENJOY...

Strange, but glad you found a solution. Hopefully this will be mostly resolved for good in Spyder 4.

No, this issue still exists in Spyder 4. I just had this issue and when used the fix cited here using Ctrl+Shift+D, the issue is fixed. You need to look into this issue and fix it permanently. Users who do not see this fix will have tough time using Help.

open spyder > tools > install kite engine. >
dOWNLOAD WILL START AUTOMATICALLY
LET IT COMPLETE.. AND ENJOY...

No, I have Kite installed but still it did not work. See my earlier comment to fix this issue.

Same here
It doesn't work.
Suggested steps do not solve the problem

Was this page helpful?
0 / 5 - 0 ratings