Tutorial Prerequisites

The PyMVPA tutorial assumes some basic knowledge about programming in Python. For a short self-assessment of your Python skills, please read the following questions. If you have an approximate answer to each of them, you can safely proceed to the tutorial. Otherwise, it is recommended that you take a look at the Python documentation resources listed under Recommended Reading and Viewing.

  • Are you using spaces or tabs for indentation? Why is that important to know?
  • What is the difference between import numpy and from numpy import *?
  • What is the difference between a Python list and a tuple?
  • What is the difference between a Python list and a Numpy ndarray?
  • What is the difference between an iterable and a generator in Python?
  • What is a list comprehension?
  • What is a callable?
  • What are *args and **kwargs usually used for?
  • When would you use ? or ?? in IPython?
  • What is the difference between a deep copy and a shallow copy?
  • What is a derived class?
  • Is it always a problem whenever a Python exception is raised?

If you could not answer many questions: Don’t panic! Python is known to be an easy-to-learn language. If you are already proficient in any other programming language, you can expect to be able to write fairly complex Python programs after a weekend of training.

What Do I Need To Get Python Running

PyMVPA code is compatible with Python 2.X series (more precisely >= 2.6). Python 3.x is supported as well, but not as widely used (yet), and many 3rd-party Python modules are still lacking Python 3 support. For now, we recommend Python 2.7 for production, but Python 2.6 should work equally well.

Any machine which has Python 2.X available can be used for PyMVPA-based processing (see chap_installation> on how to deploy PyMVPA on your system). Any GNU/Linux distribution already comes with Python by default. The Python website offers installers for Windows and MacOS X.

However, PyMVPA can make use of many additional software packages to enhance its functionality. Therefore it is preferable to use a Python distribution that offers a large variety of scientific Python packages. For Windows, Python(x,y) matches these requirements. For MacOS X, the MacPorts project offers a large variety of Python packages (including PyMVPA).

The ideal environment is, however, the Debian operating system. Debian offers the largest selection of free and open-source software in the world, and runs on almost any machine. Moreover, the NeuroDebian project provides Debian packages for a number of popular neuroscience software package, such as AFNI and FSL.

For those who just want to quickly try PyMVPA, or do not want to deal with installing multiple software package we recommend the NeuroDebian Virtual Machine. This is a virtual Debian installation that can be deployed on Linux, Windows, and MacOS X in a matter of minutes. It includes many Python packages, PyMVPA, and other neuroscience software (including AFNI and FSL).