Command line editing in python shell

Thomas Wouters thomas at
Fri Feb 2 21:14:33 CET 2001

On Fri, Feb 02, 2001 at 07:38:17PM +0000, Jacek Generowicz wrote:
> I have compiled python 2.0 on a Mandrake 7.2 installation. Command
> line editing is impossible: The up-arrow prints ^[[A and so on.
> I guess that some libraries are not being found, as I have previously
> compiled python 2.0 on a RedHat 6.2 installation and everything worked
> fine.
> Any ideas how I can fix this one ?

You have to compile in the 'readline' module. In Python 2.0 that means
editing 'Modules/Setup' and uncommenting the line that mentions readline.
You'll probably also want to uncomment some other lines.

If that doesn't work, you might lack the headerfiles for readline, or they
might be in an odd location. If you don't have them installed, you have to
find an RPM that provides them (probably readline-devel.<something>.rpm.) If
they are in an odd location, you have to tweak the -I and -L arguments
behind readline. 

This will almost all be unnecessary in Python 2.1, where the modules are
autodetected using Python's distutils. It's less easy to supply your own
location, but it will hardly be necessary, in most cases. In Python 2.1, a
single 'make' after 'configure' will build everything for you :)

Thomas Wouters <thomas at>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!

More information about the Python-list mailing list