Installing IPython
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 the default, standard package manager for Python. pip
can be installed once you have easy_install
available. The pip
command is similar to easy_install
, and adds options such as uninstalling.
How to do it...
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 setup tools 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 installpip
; for instance: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 on the OSX DVDs that came with your Mac or App Store. Follow the easy_install/pip instructions, or the installing from source instructions provided later in this section.
Installing IPython On Linux: Because 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:easy_install ipython pyzmq tornado readline
Alternatively, you can first install
pip
witheasy_install
, by typing the following command in your terminal:easy_install pip
After that, install IPython using
pip
, with the following command: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 tarball from https://github.com/ipython/ipython/downloads.
Unpack the source code from the archive:
tar xzf ipython-<version>.tar.gz
If you have Git installed, you can clone the Git repository instead:
$ git clone https://github.com/ipython/ipython.git
Go to the
ipython
directory:cd ipython
Run the
setup
script. This may require you to run the command withsudo
, as follows:sudo setup.py install
How it works...
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.