Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python's readline module not available for windows?

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'

like image 778
Anonymous Cowherd Avatar asked Jul 03 '18 14:07

Anonymous Cowherd


2 Answers

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.

like image 181
Lefteris Xris Avatar answered Sep 20 '22 18:09

Lefteris Xris


Go to your CMD terminal and type

pip install pyreadline

with in few seconds it will be installed and you will be able to see message i.e. "Successfully installed pyreadline-"

then go back to your PYSPARK terminal and type again import readline it will import now without any error

Thanks

like image 32
nixxo_raa Avatar answered Sep 17 '22 18:09

nixxo_raa