IPython can be installed in various ways, depending on your operating system. For the terminal-based shell, there is a dependency on readline
. The web notebook requires tornado
and zmq
.
In addition to installing IPython, we will install setuptools
, which gives you the easy_install
command. The easy_install
command is a popular package
manager for Python. pip
can be installed once you have easy_install
. The pip
command is similar to easy_install
and adds options such as uninstalling.
This section describes how IPython can be installed on Windows, Mac OS X, and Linux. It also describes how to install IPython and its dependencies with easy_install
and pip
, or from source:
Installing IPython and setuptools on Windows: A binary Windows installer for Python 2 or Python 3 is available on the IPython website. Also see http://ipython.org/ipython-doc/stable/install/install.html#windows.
Install setuptools with an installer from http://pypi.python.org/pypi/setuptools#files. Then install
pip
, like this:cd C:\Python27\scripts python .\easy_install-27-script.py pip
Installing IPython on Mac OS X: Install the Apple Developer Tools (Xcode) if necessary. Xcode can be found at https://developer.apple.com/xcode/. Follow the
easy_install/pip
instructions or the instructions for installation from source provided later in this section.Installing IPython on Linux: Since there are so many Linux distributions, this section will not be exhaustive:
On Debian, type the following command:
$ su – aptitude install ipython python-setuptools
On Fedora, the magic command is as follows:
$ su – yum install ipython python-setuptools-devel
The following command will install IPython on Gentoo:
$ su – emerge ipython
For Ubuntu, the install command is as follows:
$ sudo apt-get install ipython python-setuptools
Installing IPython with easy_install or pip: Install IPython and all the dependencies required for the recipes in this chapter with
easy_install
using the following command:$ sudo easy_install ipython pyzmq tornado readline
Alternatively, you can first install pip with
easy_install
by typing this command in your terminal:$ sudo easy_install pip
After that, install IPython using
pip
:$ sudo pip install ipython pyzmq tornado readline
Installing from source: If you want to use the bleeding-edge development version, then installing from source is for you:
Download the latest source archive from https://github.com/ipython/ipython/archive/master.zip.
Unpack the source code from the archive:
$ tar xzf ipython-<version>.tar.gz
Instead, if you have Git installed, you can clone the Git repository:
$ git clone https://github.com/ipython/ipython.git
Go to the root directory within the downloaded source:
$ cd ipython
Run the setup script. This may require you to run the command with
sudo
, as follows:$ sudo python setup.py install
We installed IPython using several methods. Most of these methods install the latest stable release, except when you install from source, which will install the development version.
Instructions from the official IPython website at http://ipython.org/install.html