问题
I found similar questions but none relate to my issue in MacOS
Showing all possible methods on Jupyter notebook
how to show all methods that i can choose in ipython notebook?
Many people didn't find those answers useful in MacOS as you can see in the comments.
I'm trying to use . + tab
to display all the possible methods any initialized object in Jupyter notebook like this:
(example image of a list object for context)
and none will show up. But in memory variables can be shown.
I'm launching Jupyter Notebook from my MacOS terminal from a virtual environment with the following versions
jupyter==1.0.0
jupyter-client==5.3.1
jupyter-console==6.0.0
jupyter-core==4.5.0
How can I configure Jupyter Notebook in order to show all possible methods when I use tab
?
UPDATE
- Upgraded to
notebook==6.0.1
and still doesn't work - In the same environment,
ipython
displays methods when usingtab
%config IPCompleter.greedy=True
was set and still doesn't workpyreadline
installed still doesn't work- it worked with lists but with a pandas empty data frame
df. + tab
wont display possible methods neither with an Axessubplot object. - This issue was replicated in a linux distro and the notebook hangs in kernel busy by using one thread by 100% until it finally displays the possible methods. In MacOs it doesn't hang in 'kernel busy' and won't display anything only when you add a hint (like
df.h + tab
will showhead
andhist
)
回答1:
I found that this issue was discussed here Autocomplete not working
You should downgrade your ipython
version to 6.2.1
by running in your virtual environment:
pip install ipython==6.2.1
and then restart the jupyter notebook. Now it should display the methods of any object including pandas and seaborn ones like this
回答2:
I have Jupyter notebook on Ubuntu Server running with Python3
Here what helped in my case:
Infastructure update
I had fresh install, so update pip3 package
python3 -m pip install --upgrade pip
See if there are any outdated packages
python3 -m pip list --outdated --format=freeze
If there are any (which is highly possible) use this to update everything
python3 -m pip list --outdated --format=freeze | grep -v '^-e' | cut -d = -f 1 | xargs -n1 python3 -m pip install -U
In my case I've also installed python3-cairo-dev
Core programming rules
Also it is important to remember, that you better have item defined first. Like
myAwesomeList = []
myAwesomeList.<- here we press "Tab"
来源:https://stackoverflow.com/questions/57728711/how-to-show-all-methods-possible-in-jupyter-notebook-in-macos