如何在MacOS的jupyter Notebook中显示所有可能的方法?

时间:2019-08-30 14:31:13

标签: python macos jupyter-notebook jupyter

我在 MacOS

中发现了类似的问题,但与我的问题无关

Showing all possible methods on Jupyter notebook

how to show all methods that i can choose in ipython notebook?

许多人没有在MacOS中发现这些答案,就像您在评论中看到的那样。

enter image description here

我正在尝试使用. + tab来显示Jupyter笔记本中任何已初始化对象的所有可能方法,如下所示:

(用于上下文的列表对象的示例图像)

example image of a list object for context

,没有任何显示。但是在内存中可以显示变量。

我正在从MacOS终端从具有以下版本的虚拟环境中启动Jupyter Notebook

jupyter==1.0.0
jupyter-client==5.3.1
jupyter-console==6.0.0
jupyter-core==4.5.0

当我使用tab时,如何配置Jupyter Notebook以显示所有可能的方法?


更新

  • 已升级到notebook==6.0.1,但仍然无法正常运行
  • 在同一环境中,ipython 在使用tab时显示方法
  • %config IPCompleter.greedy=True已设置,但仍然无法运行
  • pyreadline安装后仍然无法运行
  • 它可以处理列表,但不能使用大熊猫空白数据框df. + tab,也不会使用Axessubplot对象显示可能的方法。
  • 此问题已在linux发行版中复制,笔记本通过100%使用一个线程直到内核忙碌,直到最终显示可能的方法为止。在MacOs中,它不会挂在“内核繁忙”中,并且仅在您添加提示时才显示任何内容(例如df.h + tab将显示headhist

2 个答案:

答案 0 :(得分:1)

我发现这里讨论了这个问题Autocomplete not working

您应该将ipython的版本降级为6.2.1 通过在虚拟环境中运行:

pip install ipython==6.2.1

,然后重新启动jupyter笔记本。现在它应该显示任何对象的方法,包括像这样的熊猫和海生的

enter image description here

答案 1 :(得分:0)

940

这对我的情况有帮助:

基础结构更新

  1. 我已经全新安装,因此请更新pip3软件包

    python3 -m pip安装--upgrade pip

  2. 查看是否有过时的软件包

    python3 -m点列表-过时--format = freeze

  3. 如果有(很有可能)使用它来更新所有内容

    python3 -m pip列表-过期--format = freeze | grep -v'^ -e'|切-d = -f 1 | xargs -n1 python3 -m pip install -U

  4. 就我而言,我还安装了python3-cairo-dev

核心编程规则

记住,重要的是,最好先定义项目。喜欢

I have Jupyter notebook on Ubuntu Server running with Python3