Installing ipython with readline on the mac

pythoneer picture pythoneer · Apr 7, 2009 · Viewed 15.7k times · Source

I am using ipython on Mac OS 10.5 with python 2.5.1 (I would actually like to use ipython for 2.6.1, but it doesn't seem to be available?)

I installed ipython via easy_install. It works but is missing gnu readline (needed for nice searching of command line history with ctrl-R, etc.)

I found a blog post and other sources saying this could be fixed by

sudo easy_install -f http://ipython.scipy.org/dist/ readline

However, this leads to build errors in readline.c , particularly undeclared functions like rl_compentry_func_t and rl_catch_signals.

Has anyone seen these errors? Is there another way to get ipython installed with readline?

Answer

Lorin Hochstein picture Lorin Hochstein · Dec 3, 2009

To install ipython on Snow Leopard or Lion without using MacPorts, you can simply do:

sudo easy_install readline ipython

(Note that if you use the "pip" to install readline, then ipython won't see the readline library, not sure why).

Edit:

If you had ipython installed remove it with

sudo pip uninstall ipython

or

pip uninstall ipython #for virtualenvs

Then make sure you have installed readline first and reinstall iptyhon

pip install readline ipython

For some reasons, if readline wasn't present during the installation, it will install itself without support for readline or it use the default mac readline.