TAB completion does not work in Jupyter Notebook b

2020-05-15 23:43发布

TAB completion works fine in iPython terminal, but not in Firefox browser.

So far I had tried but failed,

1). run a command $ sudo easy_install readline,

then the .egg file was wrote in /usr/local/lib/python2.7/dist-packages/readline-6.2.4.1-py2.7-linux-x86_64.egg,

but TAB completion still doesn't work in Jupyter Notebook.

2). also tried to find locate the ipython_notebook_config.py or ipython_config.py, but failed.

I use Python 3.5 and iPython 4.0.0. and both are installed in Ubuntu 15.10 /usr/share/anaconda3/bin/ipython.

Any help would be appreciated!

7条回答
对你真心纯属浪费
2楼-- · 2020-05-16 00:14

My problem was in that I try to call autocomplete and import in the same cell. Because of imported thing does not initialized yet, autocomplete does not work.

All I need is call to the object in a new cell enter image description here

UPD: or just run program once in the same cell to initialize imported

查看更多
老娘就宠你
3楼-- · 2020-05-16 00:15

you can add

%config IPCompleter.greedy=True

in the first box of your Jupyter Notebook.

查看更多
Viruses.
4楼-- · 2020-05-16 00:19

In my case, after running pip install pyreadline, I needed to re-execute all the lines in Jupyter before the completion worked. I kept wondering why it worked for IPython but not Jupyter.

查看更多
来,给爷笑一个
5楼-- · 2020-05-16 00:19

The workaround I found is to assign the intermediate result to a temporary variable.then in seperate cell, using tab on temporary variable for auto-completion.

temp = pd.Description

temp.TAB

enter image description here

查看更多
可以哭但决不认输i
6楼-- · 2020-05-16 00:21

faced the same problem, for me the following worked

conda install -c anaconda jedi
查看更多
再贱就再见
7楼-- · 2020-05-16 00:22

In my case I installed miniconda on Debian Linux and most likely had a problem with the previous Python that was included with Debian. The following lines solved my problem:

conda update conda
conda update --all

The solution was taken from here based on the error that I had in IPython in terminal after writing np.<tab>:

No such file or directory: '/home/user/miniconda3/lib/python' 
查看更多
登录 后发表回答