views:

71

answers:

2

From the readline module documentation, it mentions:

On MacOS X the readline module can be implemented using the libedit library instead of GNU readline. The configuration file for libedit is different from that of GNU readline.

Is it possible to use the readline library in /usr/lib/libreadline.dylib for example, or even compiled with MacPorts or Homebrew?

A: 

It is possible to use GNU readline from MacPorts or elsewhere when building Python by specifying the additional library and include files when invoking the configure script. See the python installer build script in the Python source tree (Mac/BuildScript/build-installer.py) for an example. It builds a local copy of GNU readline when building for targets of 10.4 or earlier.

Keep in mind that on current OS X releases, /usr/lib/libreadline.dylib is merely a symlink to libedit; AFAIK, Apple does not ship GNU readline as a library in OS X:

$ ls -l /usr/lib/libreadline.dylib 
lrwxr-xr-x  1 root  wheel  15 Sep  5  2009 /usr/lib/libreadline.dylib@ -> libedit.2.dylib
Ned Deily
+1  A: 
$ sudo easy_install readline
Gerald Kaszuba
If you use easy_install instead of pip, it will download the binary egg and work without having to modify your PYTHONPATH.
Alec Thomas