简体   繁体   中英

Arrow keys not working with Enthought python

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!

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM