Be sure you have installed the pyreadline library. It is needed for tab completion and other IPython functions - in Windows it doesn't come with the IPython package and you have to install it separately -
Pyreadline is needed by ipython. Install pyreadline. This was done in Windows 7. Get pyreadline zip, pyreadline-master.zip, unzip. In powershell change directory into uzipped pyreadline, make sure python is set in Path, and enter commandpython setup.py install This will intall pyreadline in C:\Python27\Lib\site-packages
I realize this is a really old question, but none of the answers above worked for me (And this is the first hit you get when you google a question of this nature).
I should mention that this is NOT exclusive to windows, I had the problem running CentOS 6.5 and Python 2.7
Here is what I did:
apt-get/yum install ncurses-devel
#If you want history in iPython:
apt-get/yum install sqlite-devel
easy_install ipython readline
ipython
In [1]: from
Display all 391 possibilities? (y or n)
If you don't have the -devel packages, your install will fail when it comes time to link them and build the eggs.. Hope this helps others!
If you use Jupyter notebook and you still did get Tab auto-complete working after you tried all the steps suggested in the post here, you might want to check if you are trying to use the Tab auto-completion within a function definition. Ifyour import statements are part of the function such as below, you will not get the Tab auto-completion. You need to put the import statements outside the function and also execute them once before asking for auto-completion on the packages.
def myfunction():
import pandas as pd
import numpy as np
a = pd.DataFrame(np.random.normal(1,3, (4,4))
return a
I faced the same problem with the numpy library. The issue is with the particular version of ipython or jupyter notebook and it is resolved by simply updating ipython or jupyter.
If you are using a conda environment like anaconda or miniconda then update ipython in that environment by using
conda update ipython
In case of anaconda you also need to update the qtconsole
conda update qtconsole
Sometimes anaconda constraints the update of ipython then try
conda update -all
If you are not using a environment then directly update using pip
To check if ipython and the modules it uses match, run pip check ipython.
For my configuration with ipython 7.25 in July 2021, this gave a good clear warning:
ipykernel 6.0.1 has requirement importlib-metadata<4; python_version < "3.8.0", but you have importlib-metadata 4.6.0.
You may of course see different warnings --
this is just an example, unrelated to tab completion.
Then to downgrade it, e.g.
pip install 'importlib-metadata<4' # don't forget the 'quotes'