How to show all methods possible in jupyter notebook in MacOS?

蹲街弑〆低调 提交于 2021-02-10 12:12:37

问题


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 using tab
  • %config IPCompleter.greedy=True was set and still doesn't work
  • pyreadline 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 show head and hist)

回答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

  1. I had fresh install, so update pip3 package

    python3 -m pip install --upgrade pip

  2. See if there are any outdated packages

    python3 -m pip list --outdated --format=freeze

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

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!