[Tutor] readline under linux

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Wed Nov 26 15:39:52 EST 2003

On Wed, 26 Nov 2003, Guillermo Fernandez Castellanos wrote:

> Traceback (most recent call last):
>   File "<pyshell#0>", line 1, in -toplevel-
>     import readline
> ImportError: No module named readline
> I am running under linux, so i was expecting the module readline to be
> avalaible.

Hi Guillermo,

Although you have the readline library installed, you might not have the
readline 'development' files that Python needs when it compiles support
for readline.  Many Linux distributions will decouple the development
stuff from the main library, so you may need to install the readline-devel
stuff first, and then recompile Python.

> I'm I wrong about this avaibility? Or is there any dependencies to
> satisfy that I've missed? Or maybe a special option at compile time that
> I did not set?

You most likely won't have to do anything special with './configure'.
Python 2.3 should be able to autodetect readline once the development
stuff is in place.  If you're running a RPM-based distribution, like
Redhat, look for something like 'readline-devel' from your Linux
installation CD.  Similarly, if you're using a Debian-based system, look
for 'readline-dev'.

Good luck to you!

More information about the Tutor mailing list