Nate Silva

Oct 30 2007

How to make readline support work in IPython on Mac OS X Leopard

Many Python programmers use the IPython shell for interactively testing their code.

But if you recently upgraded to Mac OS X Leopard then you may have noticed that a key feature — tab-completion — doesn’t work.

It doesn’t work because IPython uses the GNU Readline library, and Mac OS X doesn’t include that. Instead, OS X ships with a similar library called Editline.

You can make IPython work with EditLine by adding the following lines near the top of your ~/.ipython/ipy_user_conf.py file:

import readline 
readline.parse_and_bind ("bind ^I rl_complete")

Note: You must be using a recent version of IPython. You can install the latest version by typing sudo easy_install ipython from the OS X command-line.

(Found in this message thread on the Pythonmac-SIG mailing list)

Page 1 of 1