IdentifiantMot de passe
Mot de passe oublié ?Je m'inscris ! (gratuit)
2.3 Installing numarray

2.3 Installing numarray

The release facility at SourceForge is accessed through the project page, Click on the "Numarray" release and you will be presented with a list of the available files. The files whose names end in ".tar.gz" are source code releases. The other files are binaries for a given platform (if any are available).

It is possible to get the latest sources directly from our CVS repository using the facilities described at SourceForge. Note that while every effort is made to ensure that the repository is always ``good'', direct use of the repository is subject to more errors than using a standard release.

2.3.1 Installing on Unix, Linux, and Mac OSX

The source distribution should be uncompressed and unpacked as follows (for example):

gunzip numarray-0.6.tar.gz
tar xf numarray-0.6.tar
Follow the instructions in the top-level directory for compilation and installation. Note that there are options you must consider before beginning. Installation is usually as simple as:
python install
python install
if you want to install all additional packages, which include numarray.convolve, numarray.fft, numarray.linear_algebra, and numarray.random_array.

See numarray-X.XX/Doc/INSTALL.txt for the latest details (X.XX is the version number).

Important Tip

Just like all Python modules and packages, the numarray module can be invoked using either the "import numarray" form, or the "from numarray import ..." form. Because most of the functions we'll talk about are in the numarray module, in this document, all of the code samples will assume that they have been preceded by a statement:
>>> from numarray import *
Note the lowercase name in numarray as opposed to Numeric.

2.3.2 Installing on Windows

To install numarray, you need to be in an account with Administrator privileges. As a general rule, always remove (or hide) any old version of numarray before installing the next version.

We have tested Numarrray on several Win-32 platforms including:

  • Windows-XP-Pro-x86 ( MSVC-6.0)
  • Windows-NT-x86 (MSVC-6.0)
  • Windows-98-x86 (MSVC-6.0) Installation from source

  1. Unpack the distribution: (NOTE: You may have to download an "unzipping" utility)
    C:\> unzip 
    C:\> cd numarray
  2. Build it using the distutils defaults:
    C:\numarray> python install
    This installs numarray in C:\pythonXX where XX is the version number of your python installation, e.g. 20, 21, etc. Installation from self-installing executable

  1. Click on the executable's icon to run the installer.
  2. Click "next" several times. I have not experimented with customizing the installation directory and don't recommend changing any of the installation defaults. If you do and have problems, let us know.
  3. Assuming everything else goes smoothly, click "finish". Testing your Installation

Once you have installed numarray, test it with:

C:\numarray> python
Python 2.2.2 (#18, Dec 30 2002, 02:26:03) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> import numarray.testall as testall
>>> testall.test()
numeric:  (0, 1115)
records:  (0, 48)
strings:  (0, 166)
objects:  (0, 72)
memmap:  (0, 75)
Each line in the above output indicates that 0 of X tests failed. X grows steadily with each release, so the numbers shown above may not be current. Installation on Cygwin

For an installation of numarray for python running on Cygwin, see section 2.3.1.

Send comments to the NumArray community.