1
votes

If I use the arrow keys in either python or ipython, I don't get what I should, but instead a weird combination of characters: everything is like in this thread, except that I never compiled python from source.

What happened is roughly this: for some mysterious reasons that nobody was able to decipher (see this thread on ubuntuforums), my Kubuntu user stopped working properly and I had to set up a new one. On this new users, I didn't have Enthought python, so I performed (I hope) a global installation of it - and Canopy.

On this python, the arrow keys don't work.

Can you please help me? Please be patient, I'm a beginner... Thanks in advance!

EDIT: output of python -c 'import readline': Traceback (most recent call last): File "", line 1, in ImportError: No module named readline

EDIT2: Inspired by your comments, I tried the following

/usr/local/Canopy_32bit/User/bin/python setup.py install

for the readline module: it worked!!! I couldn't get rid of Enthought python as I need all of the packages for scientific computation. Thanks a lot guys, you helped!

2
i don't know what the problem is, but i suspect it is incompatible console libraries - if i use a standard python, and try to import ipdb, it sort of works but looks nasty like that. haven't tracked it down yet, i just don't do that. not helpful, i know. - Corley Brigman
Can you send output of python -c 'import readline' - pankaj
Thanks everybody! Here is the output: Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named readline - user2669155
Do you get anything like the following in the output of the above commmand: Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: libreadline.so.5: cannot open shared object file: No such file or directory I had this problem and the solution was to install compat-readline5 (on Fedora), Ubuntu may have a similar package for readline which you might have to install. - pankaj

2 Answers

2
votes

If running the command python -c 'import readline' gives you the following output:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: libreadline.so.5: cannot open shared object file: No such file or directory

then you need to install the older libreadline in your system. On Ubuntu/Kubuntu it is libreadline5 , on Fedora it is compat-readline5

0
votes

I don't have enough reputation to comment, so I have to put this in as an answer, but when installing Enthought did you by any chance replace your original python install on your machine? I vaguely remember the install script asking me whether I wanted to make Enthought my default python install.

You might still need to rebuild your Python as posted in the original question that you linked.