Closed jrast closed 7 years ago
@endolith Also, for the record, the canonical conda
syntax is conda install spyder-kernels=0
.
Ok, well I still have the Ctrl+I → "No documentation available" problem after following those directions. Works from command line but not from editor.
IPython >=4.0 : 7.0.1 (OK)
cython >=0.21 : 0.28.5 (OK)
jedi >=0.9.0 : 0.13.1 (OK)
matplotlib >=2.0.0: 3.0.0 (OK)
nbconvert >=4.0 : 5.3.1 (OK)
numpy >=1.7 : 1.15.2 (OK)
pandas >=0.13.1 : 0.23.4 (OK)
pycodestyle >=2.3 : 2.4.0 (OK)
pyflakes >=0.6.0 : 2.0.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 2.1.1 (OK)
qtconsole >=4.2.0 : 4.4.1 (OK)
rope >=0.9.4 : 0.10.7 (OK)
sphinx >=0.6.6 : 1.8.1 (OK)
sympy >=0.7.3 : 1.3 (OK)
@endolith Did you try autocompletion as well from the Editor? Sometimes Spyder's third-party completion libraries rope
and jedi
aren't able to find docstrings by static analysis, while dynamic analysis is much easier to do. Do you have enum34
installed by any chance? Can you try from an environment with anaconda
version 5.3.0 installed (conda install anaconda=5.3.0
) to ensure your package versions are consistent with the supported standard? Most likely, a third-party dependency down the chain was updated that broke another dependency, etc. such that there is the problem. Thanks.
I am having similar issues.
I just did a new install of Spyder via Anaconda, on Ubuntu 16.04. As we use Python 2.X, I had to install Anaconda2-5.3.0-Linux-x86_64.sh, which uses Python 2.7.15 and Spyder 3.3.1.
I have gone to Tools -> Settings -> Editor -> Code Introspection, and checked all the options, which includes "Link to object definition."
However, control-i before a command* always gives "No documentation available."
Because I am new to Python, this is a huge issue to me. Context-sensitive usage/syntax help would be much better than looking up every command with a book, and this capability was one of the things that led me to choose Spyder.
*Note that I created a custom class and then an object of that class, and I was able to get control-i to work on that object. Perhaps I am expecting the help to be too general. Does it literally only work on objects, as opposed to classes, or any other type of command (e.g., print, import, etc.)? I guess what I am looking for is not just help on object definition, but essentially automatically calling up the man page on arbitrary keywords.
Most likely, if this isn't a machine specific issue it has to do with something with the specific versions of the third-party libraries Spyder depends on for its completion and introspection, e.g. rope, jedi, parso etc. Please paste the full output of the Spyder dependencies dialog (Help > Dependencies) in a
code-block
to help us isolate that. Also, make sure you don't have enum34
installed anywhere in your environment, Also, let us know if code completion (Tab) and go to definition (Ctrl-click a symbol name) works. Try creating and testing a fresh environment with just spyder, e.g.
conda create -n your-name-here python=2 # If you must still use Python 2...
source activate your-name-here
conda install spyder
spyder
You can also consult our Spyder Troubleshooting Guide, specifically the Basic First Aid and Emergency CPR sections,
Context-sensitive usage/syntax help would be much better than looking up every command with a book, and this capability was one of the things that led me to choose Spyder.
True, and its a very important feature for me as well (which is why I'm really hopeful for the major improvements in this area coming soon in Spyder 4), although to be fair my standard fallback is a dedicated browser window I keep open on one of my monitors to quickly Alt-Tab and search for a function, method or class of interest.
Perhaps I am expecting the help to be too general. Does it literally only work on objects, as opposed to classes, or any other type of command (e.g., print, import, etc.)?
It should work on anything that has a properly retrievable docstring, whether that is a builtin, function, class, method, instance, module, package, etc. If functions don't have docstrings or have incorrectly formatted ones, it may not be as helpful but should at least print the function signature and the other features (autocompletion, go to definition, calltips etc) should still work, and you can also switch help to source code mode to view the actual source of the function.
The main reason all this might not work for specific symbols is if a package is structured in a non-standard way or with some functions are compiled/C/FORTRAN/etc. code, common with some pandas
, numpy
, and scipy
functions, since there's no easy way for them to be retrieved statically from the source without running the code (which is why they'll work in the Console, where dynamic analysis is used for all of this, but not in the Editor where static analysis is the method of choice).
Thank you for the quick reply. I haven't tried any third-party packages yet like numpy. I was just going through the Python reserved word list and some other commands I knew and couldn't get any definitions for those.
I will try setting up the non-Anaconda version as soon as I can. My current output for dependencies is:
IPython >=4.0;<6.0: 5.8.0 (OK)
cython >=0.21 : 0.28.5 (OK)
jedi >=0.9.0 : 0.12.1 (OK)
matplotlib >=2.0.0: 2.2.3 (OK)
nbconvert >=4.0 : 5.4.0 (OK)
numpy >=1.7 : 1.15.1 (OK)
pandas >=0.13.1 : 0.23.4 (OK)
psutil >=0.3 : 5.4.7 (OK)
pycodestyle >=2.3 : 2.4.0 (OK)
pyflakes >=0.5.0 : 2.0.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.9.2 (OK)
qtconsole >=4.2.0 : 4.4.1 (OK)
rope >=0.9.4 : 0.11.0 (OK)
sphinx >=0.6.6 : 1.7.9 (OK)
sympy >=0.7.3 : 1.2 (OK)
@Jimmeee
I was just going through the Python reserved word list and some other commands I knew and couldn't get any definitions for those.
Generally, the reserved words (like def
, with
, for
etc.) won't have docstrings since are syntactical components of the language itself, unlike the builtin functions (print()
, open()
, etc), and they are very basic but few in number so you should be able to learn them soon enough. Also, aside from the builtins you won't be able to get help on a function, method or module you haven't written in import statement for in your code, since there's no way for the introspection to know what you mean (you could theoretically be referring to anything).
I will try setting up the non-Anaconda version as soon as I can.
Please stick with Anaconda; its the best way to reduce the changes of dependency problems like this and avoid a botched installation.
My current output for dependencies is:
FYI, triple backticks on their own line above and below will create a multi-line code block. I fixed your post above to demonstrate.
Ahhh, open() works. Maybe I was just trying words that have no docstring. Print doesn't work, but my understanding is that in Python 2.X, print wasn't a function (but in 3.X it is), so maybe that's why.
@Jimmeee Yes, print
is a reserved word in Python 2.x, but as of >= 2.6 it is also a function as in 3, print()
, which is how you certainly should be calling it anyway.
Hi all, I have a similar problem. My help and autocomplete does not work but only for the Keras library.
I have a base environment set-up using Anaconda which has my standard libraries (please see details above). Help and Code Autocomplete functions work perfectly fine here.
However, in my (deeplearning) environment (above), where I installed Keras, Tensorflow, Theano, for some reason Help and Code Autocomplete does not work.
I'm using Spyder 3.3.2 (and have use Conda for all installations). Any help (no pun intended) will be really appreciated!
My help and autocomplete does not work but only for the Keras library.
For many functions in some packages, like keras
and pandas
that are just wrappers to C++ extension modules, the jedi
library that Spyder uses to get docstrings may not be able to retrieve them. Unfortunately, this is a fundamental limitation of the design of the specific packages themselves, and thus there isn't much Spyder can do about this. Try triggering help from the Console instead (after first import
ing the package of interest).
So it looks like the issue is fixed by updating to the most recent version through conda
. Very sadly, due to my company policies, I am unable to update using this but only through packages found in a trusted repo and using pip install
. Naively, I updated Spyder using 'pip' which ended up breaking my whole configuration.
Is it possible to get a list of python packages and their version such that they are compatible with Spyder and do not produce the issue above? or alternatively, a list of packages and their version such that it is known that they break spyder?
I am unable to update using this but only through packages found in a trusted repo and using
pip install
I hope the massive irony of 'trusted repo' and 'pip install
' has not escaped you?
@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).
Needless to say, your company requiring pip
over authoritative, curated conda
channels for "security" is moronic to the point of lunacy.
Is it possible to get a list of python packages and their version such that they are compatible with Spyder and do not produce the issue above?
As @ccordoba12 implies above, the issue is not with Spyder not being compatible with its direct dependencies (principally jedi
in this case) but rather those dependencies not being fully compatible with the matrix of their (and other packages') dependencies (and of course, that's what makes this issue so tricky to solve for us and for users and one we hope the comprehensive overhaul of the completion infrastructure in Spyder 4 will help alleviate. As any issue with dependency specifications thus would need to be resolved by those packages, not Spyder, there isn't much we can directly do about it.
This is why we recommend you generally stick to the versions that are pinned to each version of distributions like Anaconda, that are tested together for full functionality, and only update spyder
and very specific packages that you need need a particular bug fix or new feature beyond that.
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
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)