hakunami
hakunami

Reputation: 2441

Python3.2 can not recognize UP/DOWN/LEFT/RIGHT keys in interpreter?

I am using ubuntu, linux kernel 2.6.38. I usually use python2, today, I decide to try Python3. I downloads python3 and make install it following the README. However,the python 3.2 interpreter can not recognize UP/SOWN/LEFT/RIGHT keys, these keys are available in my python 2.7 interpreter. What's wrong did I make?

enter image description here

Another question is can I choose the python version which iPython use if I have python2.7 and python3.2 at the same time.

Best Regards.

Upvotes: 3

Views: 1623

Answers (2)

Dietrich Epp
Dietrich Epp

Reputation: 213748

This happens if the GNU Readline Library is not installed. Install the development version of the Readline library and recompile. (Some Linux distros have different packages for the development version and the runtime version of a library. The development version is needed to compile packages which use the library.)

On Debian-derived distros like Ubuntu, the package is libreadline-dev.

sudo apt install libreadline-dev

On Redhat-derived distros like Fedora, the package is named readline-devel.

sudo dnf install readline-devel

You may be able to use the Editline library instead of Readline. It’s basically a different library that does the same thing.

Upvotes: 7

mata
mata

Reputation: 69082

This happens when compiling python without readline support. Install the readline developement pakckages so that the readline.so module gets build when compiling.

If you want to use ipython on both python2 and python3, you'll have to install it separately for each interpreter.

One last hint: the ubuntu already has python3 in it's repository. you can install it using:

sudo apt-get install python3 ipython3

Upvotes: 6

Related Questions