You don't say which Python you are using but the symptoms you mention are indeed usually caused by Python not being built with readline
support. These days Python on OS X can be built to use either the GNU readline
library or the Apple-supplied editline
library (AKA libedit
). You can use the following two commands to show exactly which Python you are using. If that does not help you figure out what is going on, edit your question to show the output from those commands.
Here's an example that shows a recent MacPorts Python 2.6 on OS X 10.6:
$ python -c 'import sys;print(sys.version);print(sys.executable)'
2.6.5 (r265:79063, Jul 15 2010, 01:53:46)
[GCC 4.2.1 (Apple Inc. build 5659)]
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python
$ otool -L $(python -c 'import readline; print(readline.__file__)')
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/readline.so:
/opt/local/lib/libreadline.6.1.dylib (compatibility version 6.0.0, current version 6.1.0)
/opt/local/lib/libncursesw.5.dylib (compatibility version 5.0.0, current version 5.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)
The path prefix /opt/local/
is the default location for MacPorts-installed software and the output from otool
indicates that this Python's readline
module is dynamically linked to the MacPorts-installed GNU readline
library.