1

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!

Community
  • 1
  • 1
user2669155
  • 87
  • 2
  • 9
  • 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 Mar 13 '14 at 20:43
  • 2
    Can you send output of `python -c 'import readline'` – pankaj Mar 14 '14 at 17:53
  • Thanks everybody! Here is the output: Traceback (most recent call last): File "", line 1, in ImportError: No module named readline – user2669155 Mar 14 '14 at 20:01
  • 1
    Do you get anything like the following in the output of the above commmand: Traceback (most recent call last): File "", line 1, in 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 Mar 19 '14 at 04:43

2 Answers2

2

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

pankaj
  • 1,450
  • 14
  • 15
0

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.

AkshayDandekar
  • 421
  • 2
  • 11
  • Thanks for replying! Yes, I made Enthought python default because my normal one didn't have matplotlib, scipy, numpy etc. That's actually why I use Enthought in the first place. If I revert to the normal python, I suppose I won't have those packages, am I correct? – user2669155 Mar 14 '14 at 20:03
  • Sorry for the late reply, I don't get to be on stackoverflow as often as I want to. But yeah you would not have those packages if you revert to the standard python install. However, I think that might be where the problem originated. Try to get rid of enthought as a standard and install enthought to your home/user directory or if you can try to install the whole Canopy package. You could also try to install virtualenv and virtualenvwrapper and install all the necessary python packages through that. – AkshayDandekar Mar 21 '14 at 15:20