installing python and its components

  • Python is often pre-installed on your system or easy to download. More difficult is to get the essential packages (numpy, scipy, matplotlib, ipython) and their dependencies installed. Here, I list some of the possibilities.

on MacOsX: using MacPorts

  • A basic installation procedure is to use the enthought distribution,

  • Another route is to use MacPorts. It is a generic package manager inspired by what you get using Debian's apt scheme.

  • Once installed, do on the command-line

    • on Leopard:

      sudo port install py25-pil py25-numpy py25-scipy py25-ipython py25-matplotlib +cairo+latex+tkinter
      sudo python_select python25

      (Note: you may also use python26 on Leopard).

    • on Snow Leopard:

      sudo port install py26-numpy py26-scipy py26-ipython py26-matplotlib
      sudo port install py26-pyobjc2-cocoa py26-pil py26-distribute py26-pip py26-py2app python_select
      sudo port install vtk5 +carbon +qt4_mac +python26 py26-mayavi
      sudo python_select python26

      to install a bunch of useful python packages.

    • to get a package that is not available through macports, do:

      sudo easy_install progressbar
  • for visionEgg :

    sudo port install py26-opengl py26-game
    sudo easy_install visionegg

  • on Snow Leopard, you'll have to follow these instructions.

Debian / Ubuntu

DistUtils, PIP & Easy Install

  • most of the time, there's a file:

    python install --prefix=~
  • See

  • to install numpy (same for pylab, scipy, or visionegg), simply do

    easy_install numpy
  • most of the cases, on a test server or a single-user machine, you may find more useful to install in your home dirtectory, for instance:

    easy_install -d ~/lib/python2.5/site-packages/ numpy
  • to upgrade, use

    easy_install -U numpy
  • you can browse the list of available packages.

  • for pip:

  • you may create a script tu update all packages:

    for i in `python -c "for dist in __import__('pkg_resources').working_set: print dist.project_name"`:
    echo "`easy_install -U $i`"
    echo "++++++++++++++++++++++++++++++++++++++++++++++++++"
  • to install PIL, use

    easy_install -d lib/python2.6/site-packages/ --find-links Imaging

SVNs: bleeding edge versions

  • numpy

    svn co numpy
    cd numpy
    python build
    sudo python install
    rm -rf build
    cd ..
  • SciPy

    svn co scipy
    cd scipy
    python build
    sudo python install
    rm -rf build
    cd ..
  • pylab

    svn co matplotlib
    cd matplotlib
    python build
    sudo python install
    sudo rm -rf build
    cd ..
  • SPE

    svn checkout svn://
  • PIL

    tar zxvf  Imaging-1.1.6.tar.gz
    cd Imaging-1.1.6
    python build_ext -i
    python install
  • gsl

    cvs -d login
    cvs -d checkout gsl
    cd gsl/
    ./configure --enable-maintainer-mode
  • pytables

    • dependency on HDF

      tar zxvf hdf5-1.6.5.tar.gz
      cd hdf5-1.6.5
      ./configure --enable-cxx
      make install
      h5ls -r  Documents/Sci/projets/virtualV1/experiments/benchmark_one/results/benchmark_retina_high.h5
      tar zxvf Pyrex-
      cd Pyrex-
      python build
      sudo python install
      rm -rf build
    • install

      #svn co pytables
      tar zxvf pytables-1.4.tar.gz
      cd pytables-1.4
      export DYLD_LIBRARY_PATH=/sw/lib # or in .bashrc
      python install --hdf5=/sw
      cd ..
  • pygtk

    tar xvfj pygtk-2.8.6.tar.bz2
    cd pygtk-2.8.6
    sudo make install    # or without sudo as root
    cd ..