views:

73

answers:

2

I want a 64-bit python interpreter on my Mac so I had to rebuild from source. However, with my own custom build interpreter I run into issues when I try to navigate when I run the interpreter from inside a shell. Typing python into the bash shell results in the familiar:

Python 2.6.3 (r263:75183, Oct 23 2009, 14:23:25) 
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

However, when I try to navigate with left-arrow and right-arrow, I get weird characters:

Python 2.6.3 (r263:75183, Oct 23 2009, 14:23:25) 
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ^[[A^[[A^[[A^[[D^[[C^[[C^[[A^[[B^[[D^[[C

This does not occur in Apple's default interpreter.

What is causing this? How can I fix it?

+6  A: 

Sounds like your custom build didn't include readline. Should be a simple config change and rebuild, check here for more info.

Mercurybullet
Thanks. Apparently Appled does not include the GNU readline utility by default. It can be downloaded and installed from http://tiswww.case.edu/php/chet/readline/rltop.html
celil
A: 

Installing the GNU readline library from here, and rebuilding python fixes the problem.

celil