python's readline module not available for windows?

Anonymous Cowherd picture Anonymous Cowherd · Jul 3, 2018 · Viewed 12.8k times · Source

Granted I've been off PYTHON for two + years. I'm trying to get back into the swing, and I remember having command and variable completion available on windows a few years back. We were stuck in 2.6 as we had dependencies.

Today, I'm trying to import readline. I get this message from pip.

C:\Users\Joe>pip3 install readline Collecting readline Using cached https://files.pythonhosted.org/packages/f4/01/2cf081af8d880b44939a5f1b446551a7f8d59eae414277fd0c303757ff1b/readline-6.2.4.1.tar.gz Complete output from command python setup.py egg_info:error: this module is not meant to work on Windows

my version is:

Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. import readline Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'readline'

Answer

Lefteris Xris picture Lefteris Xris · Aug 22, 2018

I have recently faced the same issue on Windows 10. readline is not available for Windows, however there is pyreadline package which is for windows and you may try it.

Try to install pyreadline and use it instead of readline:

$pip install pyreadline

or

$python -m pip install pyreadline


Then, in your python file do this:

from pyreadline import Readline
readline = Readline()

That way, you can use readline in Windows like in linux systems.