User guide

NumPy User Guide, Release 1.9.0
A lightweight alternative is to download the Python installer from www.python.org and the NumPy installer for your
Python version from the Sourceforge download site
The NumPy installer includes binaries for different CPU’s (without SSE instructions, with SSE2 or with SSE3) and
installs the correct one automatically. If needed, this can be bypassed from the command line with
numpy-<1.y.z>-superpack-win32.exe /arch nosse
or ‘sse2’ or ‘sse3’ instead of ‘nosse’.
Linux
Most of the major distributions provide packages for NumPy, but these can lag behind the most recent NumPy release.
Pre-built binary packages for Ubuntu are available on the scipy ppa. Redhat binaries are available in the EPD.
Mac OS X
A universal binary installer for NumPy is available from the download site. The EPD provides NumPy binaries.
1.2.2 Building from source
A general overview of building NumPy from source is given here, with detailed instructions for specific platforms
given seperately.
Prerequisites
Building NumPy requires the following software installed:
1. Python 2.4.x, 2.5.x or 2.6.x
On Debian and derivative (Ubuntu): python, python-dev
On Windows: the official python installer at www.python.org is enough
Make sure that the Python package distutils is installed before continuing. For example, in Debian GNU/Linux,
distutils is included in the python-dev package.
Python must also be compiled with the zlib module enabled.
2. Compilers
To build any extension modules for Python, you’ll need a C compiler. Various NumPy modules use FORTRAN
77 libraries, so you’ll also need a FORTRAN 77 compiler installed.
Note that NumPy is developed mainly using GNU compilers. Compilers from other vendors such as Intel,
Absoft, Sun, NAG, Compaq, Vast, Porland, Lahey, HP, IBM, Microsoft are only supported in the form of
community feedback, and may not work out of the box. GCC 3.x (and later) compilers are recommended.
3. Linear Algebra libraries
NumPy does not require any external linear algebra libraries to be installed. However, if these are available,
NumPy’s setup script can detect them and use them for building. A number of different LAPACK library setups
can be used, including optimized LAPACK libraries such as ATLAS, MKL or the Accelerate/vecLib framework
on OS X.
1.2. Building and installing NumPy 5