Skip to content
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

Automatic Help/Documentation with Ctrl+I is broken in the Editor #5393

Closed
joshburnett opened this issue Oct 4, 2017 · 60 comments
Closed

Automatic Help/Documentation with Ctrl+I is broken in the Editor #5393

joshburnett opened this issue Oct 4, 2017 · 60 comments

Comments

@joshburnett
Copy link

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)

@ccordoba12
Copy link
Member

ccordoba12 commented Oct 4, 2017

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

@dalthviz
Copy link
Member

dalthviz commented Oct 5, 2017

@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?

@joshburnett
Copy link
Author

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

Thanks.

@joshburnett
Copy link
Author

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.

@dalthviz
Copy link
Member

dalthviz commented Oct 5, 2017

Thanks @joshburnett for your feedback and providing a way to fix this 👍

@ccordoba12
Copy link
Member

@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!

@joshburnett
Copy link
Author

Sure. You can get the file here.

@CoderCoderCoder
Copy link

CoderCoderCoder commented Oct 7, 2017

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.

@joshburnett
Copy link
Author

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.

@joshburnett joshburnett reopened this Oct 19, 2017
@joshburnett
Copy link
Author

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.

@pogacsa
Copy link

pogacsa commented Nov 24, 2017

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?

@rmNyro
Copy link

rmNyro commented Feb 11, 2018

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.

@jabaa
Copy link

jabaa commented Aug 5, 2018

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.

@CAM-Gerlach
Copy link
Member

@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).

@maxiwu
Copy link

maxiwu commented Oct 16, 2018

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.

@CAM-Gerlach
Copy link
Member

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.

@sudo-robot-destroy
Copy link

sudo-robot-destroy commented Nov 14, 2018

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.

@CAM-Gerlach
Copy link
Member

CAM-Gerlach commented Nov 14, 2018

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

@sudo-robot-destroy
Copy link

@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?

@CAM-Gerlach
Copy link
Member

@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).

@douglas-putnam
Copy link

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.

@michaelasavino
Copy link

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.

@low-ham
Copy link

low-ham commented Feb 18, 2019

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

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

@ccordoba12
Copy link
Member

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.

@al-yakubovich
Copy link

same problem

@BikashPandey17
Copy link

@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.

@srichandarkoti
Copy link

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

@dzbyr
Copy link

dzbyr commented Nov 4, 2019

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

@dian-ai
Copy link

dian-ai commented Dec 31, 2019

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

@CAM-Gerlach
Copy link
Member

@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?

@dzbyr
Copy link

dzbyr commented Dec 31, 2019

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

@dian-ai
Copy link

dian-ai commented Dec 31, 2019

@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
Copy link

dian-ai commented Dec 31, 2019

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

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

@ccordoba12
Copy link
Member

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

@CAM-Gerlach
Copy link
Member

@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

@shambhaviparashar
Copy link

It doesn't work for depreciated libraries.

@CAM-Gerlach
Copy link
Member

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.

@shambhaviparashar
Copy link

@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.

@CAM-Gerlach
Copy link
Member

@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.

@JaneMiso
Copy link

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

@VenkateshDharavath
Copy link

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.

@samshadali
Copy link

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

@PraveenTumma
Copy link

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.

@PraveenTumma
Copy link

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.

@eduardosuela
Copy link

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

@StephanAKoehler
Copy link

I just installed ver 4.2.1, and was following the tutorial. Defined function hello, and then asked for help: help(hello). Got following error

help( hello )
Traceback (most recent call last):

File "", line 1, in
help( hello )

NameError: name 'help' is not defined

@ccordoba12
Copy link
Member

@StephanAKoehler, you need to run your code first and the call help(hello) in the console.

@CAM-Gerlach
Copy link
Member

CAM-Gerlach commented Jan 29, 2021

Also, note that help is a Python builtin, not a Spyder-specific function; see its docs and note that as it is intended for interactive use, not use in scripts. It is possible, depending on how you configure your interpreter and what code you've run before it, for it not to be imported by default or masked by something else. If you still can't get it working, you can import it via import builtins and run it via builtins.help(<OBJECT>), or use Spyder's own Ctrl-I help. Best of luck.

@StephanAKoehler
Copy link

thanks ccordoba12 and CAM-Gerlach.
I did run the code from the editor, still didn't get help to work

I also imported builtins, but it doesn't have a help function.
Ctrl-I does work though

Another thing works is
hello?
Signature: hello()
Docstring:
File: ~/.spyder-py3/temp.py
Type: function

@CAM-Gerlach
Copy link
Member

Given my testing confirms that help is present and loaded by default, inside and outside Spyder, in Spyder's builtin Python, Anaconda Python, Python.org Python and Ubuntu Python on Linux and Windows, I'm not sure precisely what the issue is, but it doesn't seem to be with Spyder. Most likely, either the Python distribution you are using (e.g. Sublime, Micropython, etc) lacks it, or your site/siteprofile/sitecusotmize/etc configuration is not loading by default.

While it doesn't seem to have anything to do with Spyder, it would be helpful if you wouldn't mind letting us know the output of import sys; print(sys.executable), and/or what Python interpreter you're using with Spyder. Thanks!

@Mte90
Copy link
Contributor

Mte90 commented Mar 2, 2023

So I have the same issue with 5.4.2 release.
Apart the problem that doesn't remember the source and everytime I have to set Editor it is still with the usual placeholder message, also if I press Ctrl+I often doesn't work.

Sometimes I get a warning about a crash of Sphinx 5.3.0 (asks for jsmath so I installed manually the library package but the issue is still there) also if I am using the plain text version.

immagine

Also the placeholder message is not easy to understand is Ctrl+i or Ctrl+shift+i (as the i is uppercase in this message).

@ccordoba12
Copy link
Member

ccordoba12 commented Mar 15, 2023

Apart the problem that doesn't remember the source and everytime I have to set Editor

You shouldn't need to worry about it. It's there mostly to show where the documentation is being retrieved from and it's automatically changed when you press Ctrl+I in the IPython console or Editor.

Sometimes I get a warning about a crash of Sphinx 5.3.0 (asks for jsmath so I installed manually the library package but the issue is still there) also if I am using the plain text version.

This could be the cause of your problem. But please open a new issue about it and don't forget to mention for what specific objects our Help pane is not working.

Also the placeholder message is not easy to understand is Ctrl+i or Ctrl+shift+i

If the shortcut were Ctrl+Shift+I, it'd be mentioned as such because our shortcuts (and shortcuts in other apps as well) include all keys that users need to press to make them work. For instance, these are our default shortcuts to switch to different panes:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests