Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing readline module in python3

Tags:

python-3.x

I had older version of python pre-installed on Ubuntu. I recently installed new python3.4 version without removing the older one. In python3 I am not able to see the command history. Searching around, I found that readline module is responsible for the command history and it is missing in python3. So I installed it using

sudo apt-get install libreadline6-dev

It gets installed without any error but python3 still has no readline module. How do I install it to get command history in python3.

like image 886
Mahesh Avatar asked Apr 09 '14 19:04

Mahesh


1 Answers

I was experiencing the same problem and found my fix here.

sudo apt-get install libncurses5-dev
sudo -H pip3 install readline

I'm not sure how universal the answer is though, you might need more packages (for example the libreadline6-dev package you mentioned) before you could install readline with pip3

like image 159
lingxiao Avatar answered Sep 30 '22 13:09

lingxiao