Installing pip and ipython on a Mac

Way back when I met Alex Clemesha and Dorian Raymer, two talented surfers/pythonistas, who recommended iPython. For some reason I never knew of it and it became an indepensible tool when hacking through the shell. Note: these guys are the masterminds behind CodeNode and WikipediaGame and I expect to read about these guys in the future.

In this posting, I want to show you how to install ipython on your Mac using pip (a utility for installing python packages).


First, let's get our pip on. Installing pip is really easy and it actually uses the easy_install python command itself. Open your terminal and type in:

donnie-demuths-macbook-air:Sites donnie$ sudo easy_install pip
Password: *******
Searching for pip
Best match: pip 0.4
Processing pip-0.4-py2.5.egg
pip 0.4 is already the active version in easy-install.pth
Installing pip script to /usr/local/bin

Using /Library/Python/2.5/site-packages/pip-0.4-py2.5.egg
Processing dependencies for pip
Finished processing dependencies for pip
donnie-demuths-macbook-air:Sites donnie$

Now we can install ipython using the pip install command. Again, in your terminal type:
donnie-demuths-macbook-air:Sites donnie$ sudo pip install ipython
Downloading/unpacking ipython
Downloading ipython-0.9.1.tar.gz (2.8Mb): 2.8Mb downloaded
In the tar file /tmp/tmpNxQZPw/ipython-0.9.1.tar.gz the member ipython-0.9.1/IPython/testing/attic/
Running egg_info for package ipython
Installing collected packages: ipython
Running install for ipython
Installing iptest script to /usr/local/bin
Installing ipythonx script to /usr/local/bin
Installing ipcluster script to /usr/local/bin
Installing ipython script to /usr/local/bin
Installing pycolor script to /usr/local/bin
Installing ipcontroller script to /usr/local/bin
Installing ipengine script to /usr/local/bin
Successfully installed ipython
donnie-demuths-macbook-air:Sites donnie$
Now you can use ipython by typing ipython.


Q. So why should I use pip?
A. pip is the new hotness. It's a huge upgrade over easy_install and makes sure you have all of the dependencies before it tries to install a package. We (royal "we") have all tried to install a package that just would not work: missing dependencies, corrupt files, poor error messages. Nope, that's not going to happen anymore!

Q. And what's the benefit of using ipython?
A. It provides a lot of extra features not included in the basic python shell. Some are syntax higlighting, tab-completion, and being able to man (or find more info) about a particular variable. Check it out...

  1. gravatar

    # by Husbane - September 13, 2012 at 4:35 PM

    This comment has been removed by the author.
  2. gravatar

    # by Anonymous - November 8, 2012 at 1:01 AM

    Thanks...was very helpful.

  3. gravatar

    # by msankhala - January 23, 2013 at 2:46 AM

    Thanks a lot. Nice guide. I was struggling whether i should install ipyton using macport or directly from source code.