install.txt
293 lines
| 10.8 KiB
| text/plain
|
TextLexer
Brian Granger
|
r1690 | Overview | ||
======== | ||||
Fernando Perez
|
r1753 | This document describes the steps required to install IPython. IPython is | ||
organized into a number of subpackages, each of which has its own dependencies. | ||||
All of the subpackages come with IPython, so you don't need to download and | ||||
install them separately. However, to use a given subpackage, you will need to | ||||
install all of its dependencies. | ||||
Brian Granger
|
r1690 | |||
Please let us know if you have problems installing IPython or any of its | ||||
Fernando Perez
|
r2113 | dependencies. Officially, IPython requires Python version 2.5 or 2.6. We | ||
have *not* yet started to port IPython to Python 3.0. | ||||
Brian Granger
|
r1690 | |||
.. warning:: | ||||
Fernando Perez
|
r2113 | Officially, IPython supports Python versions 2.5 and 2.6. | ||
IPython 0.10 has only been well tested with Python 2.5 and 2.6. Parts of | ||||
it may work with Python 2.4, but we do not officially support Python 2.4 | ||||
anymore. If you need to use 2.4, you can still run IPython 0.9. | ||||
Brian Granger
|
r1690 | |||
Fernando Perez
|
r1753 | Some of the installation approaches use the :mod:`setuptools` package and its | ||
:command:`easy_install` command line program. In many scenarios, this provides | ||||
the most simple method of installing IPython and its dependencies. It is not | ||||
required though. More information about :mod:`setuptools` can be found on its | ||||
website. | ||||
More general information about installing Python packages can be found in | ||||
Python's documentation at http://www.python.org/doc/. | ||||
Brian Granger
|
r1690 | |||
Brian Granger
|
r1729 | Quickstart | ||
========== | ||||
Fernando Perez
|
r1866 | If you have :mod:`setuptools` installed and you are on OS X or Linux (not | ||
Windows), the following will download and install IPython *and* the main | ||||
optional dependencies:: | ||||
Brian Granger
|
r1729 | |||
$ easy_install ipython[kernel,security,test] | ||||
Fernando Perez
|
r1866 | This will get Twisted, zope.interface and Foolscap, which are needed for | ||
IPython's parallel computing features as well as the nose package, which will | ||||
enable you to run IPython's test suite. To run IPython's test suite, use the | ||||
:command:`iptest` command:: | ||||
Brian Granger
|
r1729 | |||
$ iptest | ||||
Read on for more specific details and instructions for Windows. | ||||
Brian Granger
|
r1690 | |||
Installing IPython itself | ||||
========================= | ||||
Fernando Perez
|
r1753 | Given a properly built Python, the basic interactive IPython shell will work | ||
with no external dependencies. However, some Python distributions | ||||
(particularly on Windows and OS X), don't come with a working :mod:`readline` | ||||
module. The IPython shell will work without :mod:`readline`, but will lack | ||||
many features that users depend on, such as tab completion and command line | ||||
editing. See below for details of how to make sure you have a working | ||||
:mod:`readline`. | ||||
Brian Granger
|
r1690 | |||
Installation using easy_install | ||||
------------------------------- | ||||
Fernando Perez
|
r1753 | If you have :mod:`setuptools` installed, the easiest way of getting IPython is | ||
Fernando Perez
|
r1866 | to simple use :command:`easy_install`:: | ||
Fernando Perez
|
r1753 | |||
Brian Granger
|
r1729 | $ easy_install ipython | ||
Brian Granger
|
r1690 | |||
That's it. | ||||
Installation from source | ||||
------------------------ | ||||
Fernando Perez
|
r1753 | If you don't want to use :command:`easy_install`, or don't have it installed, | ||
just grab the latest stable build of IPython from `here | ||||
Fernando Perez
|
r1866 | <http://ipython.scipy.org/dist/>`_. Then do the following:: | ||
Brian Granger
|
r1690 | |||
$ tar -xzf ipython.tar.gz | ||||
$ cd ipython | ||||
$ python setup.py install | ||||
Fernando Perez
|
r1753 | |||
If you are installing to a location (like ``/usr/local``) that requires higher | ||||
permissions, you may need to run the last command with :command:`sudo`. | ||||
Brian Granger
|
r1690 | |||
Windows | ||||
------- | ||||
Fernando Perez
|
r1866 | There are a few caveats for Windows users. The main issue is that a basic | ||
``python setup.py install`` approach won't create ``.bat`` file or Start Menu | ||||
Fernando Perez
|
r2113 | shortcuts, which most users want. To get an installation with these, you can | ||
use any of the following alternatives: | ||||
Brian Granger
|
r1690 | |||
Fernando Perez
|
r1866 | 1. Install using :command:`easy_install`. | ||
Brian Granger
|
r1690 | |||
Fernando Perez
|
r1866 | 2. Install using our binary ``.exe`` Windows installer, which can be found at | ||
`here <http://ipython.scipy.org/dist/>`_ | ||||
Brian Granger
|
r1690 | |||
Fernando Perez
|
r1866 | 3. Install from source, but using :mod:`setuptools` (``python setupegg.py | ||
Fernando Perez
|
r1754 | install``). | ||
Brian Granger
|
r1690 | |||
Fernando Perez
|
r2113 | IPython by default runs in a termninal window, but the normal terminal | ||
application supplied by Microsoft Windows is very primitive. You may want to | ||||
download the excellent and free Console_ application instead, which is a far | ||||
superior tool. You can even configure Console to give you by default an | ||||
IPython tab, which is very convenient to create new IPython sessions directly | ||||
from the working terminal. | ||||
.. _Console: http://sourceforge.net/projects/console | ||||
Brian Granger
|
r1690 | Installing the development version | ||
---------------------------------- | ||||
Fernando Perez
|
r1753 | It is also possible to install the development version of IPython from our | ||
`Bazaar <http://bazaar-vcs.org/>`_ source code repository. To do this you will | ||||
need to have Bazaar installed on your system. Then just do:: | ||||
Brian Granger
|
r1690 | $ bzr branch lp:ipython | ||
$ cd ipython | ||||
$ python setup.py install | ||||
Fernando Perez
|
r1866 | Again, this last step on Windows won't create ``.bat`` files or Start Menu | ||
shortcuts, so you will have to use one of the other approaches listed above. | ||||
Brian Granger
|
r1690 | |||
Fernando Perez
|
r1753 | Some users want to be able to follow the development branch as it changes. If | ||
you have :mod:`setuptools` installed, this is easy. Simply replace the last | ||||
Fernando Perez
|
r1754 | step by:: | ||
Brian Granger
|
r1690 | |||
$ python setupegg.py develop | ||||
Fernando Perez
|
r1754 | This creates links in the right places and installs the command line script to | ||
the appropriate places. Then, if you want to update your IPython at any time, | ||||
just do:: | ||||
Fernando Perez
|
r1753 | |||
Brian Granger
|
r1690 | $ bzr pull | ||
Basic optional dependencies | ||||
=========================== | ||||
Fernando Perez
|
r1866 | There are a number of basic optional dependencies that most users will want to | ||
get. These are: | ||||
Brian Granger
|
r1690 | |||
* readline (for command line editing, tab completion, etc.) | ||||
* nose (to run the IPython test suite) | ||||
* pexpect (to use things like irunner) | ||||
Fernando Perez
|
r1866 | If you are comfortable installing these things yourself, have at it, otherwise | ||
read on for more details. | ||||
Brian Granger
|
r1690 | |||
readline | ||||
-------- | ||||
Fernando Perez
|
r1754 | In principle, all Python distributions should come with a working | ||
:mod:`readline` module. But, reality is not quite that simple. There are two | ||||
common situations where you won't have a working :mod:`readline` module: | ||||
Brian Granger
|
r1690 | |||
* If you are using the built-in Python on Mac OS X. | ||||
* If you are running Windows, which doesn't have a :mod:`readline` module. | ||||
Fernando Perez
|
r1753 | On OS X, the built-in Python doesn't not have :mod:`readline` because of | ||
license issues. Starting with OS X 10.5 (Leopard), Apple's built-in Python has | ||||
a BSD-licensed not-quite-compatible readline replacement. As of IPython 0.9, | ||||
many of the issues related to the differences between readline and libedit have | ||||
been resolved. For many users, libedit may be sufficient. | ||||
Most users on OS X will want to get the full :mod:`readline` module. To get a | ||||
Fernando Perez
|
r1754 | working :mod:`readline` module, just do (with :mod:`setuptools` installed):: | ||
Brian Granger
|
r1690 | |||
$ easy_install readline | ||||
.. note: | ||||
Other Python distributions on OS X (such as fink, MacPorts and the | ||||
official python.org binaries) already have readline installed so | ||||
you don't have to do this step. | ||||
Fernando Perez
|
r1753 | If needed, the readline egg can be build and installed from source (see the | ||
wiki page at http://ipython.scipy.org/moin/InstallationOSXLeopard). | ||||
Brian Granger
|
r1690 | |||
Brian Granger
|
r1788 | On Windows, you will need the PyReadline module. PyReadline is a separate, | ||
Fernando Perez
|
r1753 | Windows only implementation of readline that uses native Windows calls through | ||
Brian Granger
|
r1788 | :mod:`ctypes`. The easiest way of installing PyReadline is you use the binary | ||
Fernando Perez
|
r1866 | installer available `here <http://ipython.scipy.org/dist/>`_. The :mod:`ctypes` | ||
module, which comes with Python 2.5 and greater, is required by PyReadline. It | ||||
is available for Python 2.4 at http://python.net/crew/theller/ctypes. | ||||
Brian Granger
|
r1690 | |||
nose | ||||
---- | ||||
Fernando Perez
|
r1753 | To run the IPython test suite you will need the :mod:`nose` package. Nose | ||
provides a great way of sniffing out and running all of the IPython tests. The | ||||
Fernando Perez
|
r1754 | simplest way of getting nose, is to use :command:`easy_install`:: | ||
Brian Granger
|
r1690 | |||
$ easy_install nose | ||||
Fernando Perez
|
r1754 | Another way of getting this is to do:: | ||
Brian Granger
|
r1690 | |||
Brian Granger
|
r1729 | $ easy_install ipython[test] | ||
Brian Granger
|
r1690 | |||
Fernando Perez
|
r1753 | For more installation options, see the `nose website | ||
<http://somethingaboutorange.com/mrl/projects/nose/>`_. Once you have nose | ||||
Fernando Perez
|
r1754 | installed, you can run IPython's test suite using the iptest command:: | ||
Fernando Perez
|
r1753 | |||
Brian Granger
|
r1690 | $ iptest | ||
pexpect | ||||
------- | ||||
Fernando Perez
|
r1753 | The `pexpect <http://www.noah.org/wiki/Pexpect>`_ package is used in IPython's | ||
Fernando Perez
|
r1754 | :command:`irunner` script. On Unix platforms (including OS X), just do:: | ||
Brian Granger
|
r1690 | |||
$ easy_install pexpect | ||||
Windows users are out of luck as pexpect does not run there. | ||||
Dependencies for IPython.kernel (parallel computing) | ||||
==================================================== | ||||
Fernando Perez
|
r1753 | The IPython kernel provides a nice architecture for parallel computing. The | ||
main focus of this architecture is on interactive parallel computing. These | ||||
features require a number of additional packages: | ||||
Brian Granger
|
r1690 | |||
* zope.interface (yep, we use interfaces) | ||||
* Twisted (asynchronous networking framework) | ||||
* Foolscap (a nice, secure network protocol) | ||||
* pyOpenSSL (security for network connections) | ||||
On a Unix style platform (including OS X), if you want to use :mod:`setuptools`, you can just do:: | ||||
Fernando Perez
|
r1753 | |||
Brian Granger
|
r1729 | $ easy_install ipython[kernel] # the first three | ||
$ easy_install ipython[security] # pyOpenSSL | ||||
Brian Granger
|
r1690 | |||
zope.interface and Twisted | ||||
-------------------------- | ||||
Fernando Perez
|
r1866 | Twisted [Twisted]_ and zope.interface [ZopeInterface]_ are used for networking | ||
related things. On Unix style platforms (including OS X), the simplest way of | ||||
getting the these is to use :command:`easy_install`:: | ||||
Brian Granger
|
r1690 | |||
$ easy_install zope.interface | ||||
$ easy_install Twisted | ||||
Fernando Perez
|
r1753 | Of course, you can also download the source tarballs from the `Twisted website | ||
<twistedmatrix.org>`_ and the `zope.interface page at PyPI | ||||
<http://pypi.python.org/pypi/zope.interface>`_ and do the usual ``python | ||||
setup.py install`` if you prefer. | ||||
Brian Granger
|
r1690 | |||
Windows is a bit different. For zope.interface and Twisted, simply get the latest binary ``.exe`` installer from the Twisted website. This installer includes both zope.interface and Twisted and should just work. | ||||
Foolscap | ||||
-------- | ||||
Brian Granger
|
r1788 | Foolscap [Foolscap]_ uses Twisted to provide a very nice secure RPC protocol that we use to implement our parallel computing features. | ||
Fernando Perez
|
r1753 | |||
Fernando Perez
|
r1754 | On all platforms a simple:: | ||
Brian Granger
|
r1690 | |||
$ easy_install foolscap | ||||
Fernando Perez
|
r1753 | should work. You can also download the source tarballs from the `Foolscap | ||
website <http://foolscap.lothar.com/trac>`_ and do ``python setup.py install`` | ||||
if you prefer. | ||||
Brian Granger
|
r1690 | |||
pyOpenSSL | ||||
--------- | ||||
Fernando Perez
|
r1866 | IPython requires an older version of pyOpenSSL [pyOpenSSL]_ (0.6 rather than | ||
the current 0.7). There are a couple of options for getting this: | ||||
Fernando Perez
|
r1753 | |||
Brian Granger
|
r1690 | 1. Most Linux distributions have packages for pyOpenSSL. | ||
2. The built-in Python 2.5 on OS X 10.5 already has it installed. | ||||
3. There are source tarballs on the pyOpenSSL website. On Unix-like | ||||
platforms, these can be built using ``python seutp.py install``. | ||||
4. There is also a binary ``.exe`` Windows installer on the `pyOpenSSL website <http://pyopenssl.sourceforge.net/>`_. | ||||
Dependencies for IPython.frontend (the IPython GUI) | ||||
=================================================== | ||||
wxPython | ||||
-------- | ||||
Fernando Perez
|
r1753 | Starting with IPython 0.9, IPython has a new IPython.frontend package that has | ||
a nice wxPython based IPython GUI. As you would expect, this GUI requires | ||||
wxPython. Most Linux distributions have wxPython packages available and the | ||||
built-in Python on OS X comes with wxPython preinstalled. For Windows, a | ||||
binary installer is available on the `wxPython website | ||||
Fernando Perez
|
r1754 | <http://www.wxpython.org/>`_. | ||
Brian Granger
|
r1788 | |||
.. [Twisted] Twisted matrix. http://twistedmatrix.org | ||||
.. [ZopeInterface] http://pypi.python.org/pypi/zope.interface | ||||
.. [Foolscap] Foolscap network protocol. http://foolscap.lothar.com/trac | ||||
Fernando Perez
|
r1866 | .. [pyOpenSSL] pyOpenSSL. http://pyopenssl.sourceforge.net | ||