python console tab completion not working in windows
I'd discourage use of pyreadline
where possible, as it was written to support IPython, and stopped active development when IPython stopped using readline
/pyreadline
to support their REPL.
As an alternative, I'd suggest IPython itself; it implements their own tab-completion features (using prompt_toolkit
as of 5.0) that work in a terminal agnostic fashion. If you install and use ipython
, you'll get tab completion and the host of other features it provides to improve the interactive experience. Using the py.exe
manager application bundled with modern Python, install it for Python 3 (in an admin elevated command prompt if Python installed for all users) with:
py -3 -mpip install ipython
then to run it:
py -3 -mIPython
If you don't want the whole of ipython
just to get these features, the prompt_toolkit
folks do provide a minimalist ptpython
REPL that is basically "Python with a REPL provided by prompt_toolkit
" without all the other IPython bells and whistles.
The builtin completion relies on the GNU readline
library.
You may be able to get completion working by installing the python version (pyreadline) of this package on Windows.
python -m pip install pyreadline
The original pyreadline
is no longer maintained and doesn't work on newer versions of Python (>=3.10).
Installing pyreadline3
works:
python -m pip install pyreadline3