Supported systems

  • *nix like OS (Linux, Unix, …)
  • Mac OS

Other operating systems have not been tested and they likely require a more complex procedure for the installation (this includes the Microsoft Windows family..).

We reccommend to work in a virtual environment using virtualenv or Anaconda.

Installation requirements

  • gcc (or an alternative C/C++ compiler), e.g. on Ubuntu:
  • gfortran (or an alternative Fortran compiler), e.g. on Ubuntu:
  • python2 or python3 (with development files)

Installing requirements on Ubuntu

sudo apt-get install gcc libc6-dev
sudo apt-get install gfortran libgfortran3

with python2

sudo apt-get install python python-dev

or python3

sudo apt-get install python3 python3-dev

Installing requirements on Mac OS (using homebrew)

brew install llvm
brew install gfortran

with python2

brew install python

or python3

brew install python3


First of all make sure to have the latest version of pip installed

pip install --upgrade pip

The package and its python dependencies can be installed running the commands:

pip install --upgrade numpy
pip install --upgrade TransportMaps

If one whish to enable some of the optional dependencies:

MPI=True SPHINX=True PLOT=True H5PY=True pip install --upgrade TransportMaps

These options will install the following modules:

  • MPI – parallelization routines (see the tutorial). It requires the separate installation of an MPI backend (openMPI, mpich, etc.). The following Python modules will be installed:
  • PLOT – plotting capabilities:
  • SPHINX – documentation generation packages
  • H5PY – routines for the storage of big data-set. It requires the separate installation of the hdf5 backend.
  • PYHMC – routines for Hamiltonian Markov Chain Monte Carlo

Manual installation

If anything goes wrong with the automatic installation you can try to install from source:

git clone
cd transportmaps
pip install --upgrade numpy
pip install --upgrade -r requirements.txt
python install

The following optional requirements can be installed as well:

pip install --upgrade -r requirements-MPI.txt
pip install --upgrade -r requirements-PLOT.txt
pip install --upgrade -r requirements-SPHINX.txt
pip install --upgrade -r requirements-H5PY.txt

Running the Unit Tests

Unit tests are available and can be run through the command:

>>> import TransportMaps as TM
>>> TM.tests.run_all()

There are >3500 unit tests, and it will take some time to run all of them.


List of Frequently Asked Questions

  • The package mpi4py fail to install with error: missing <mpi.h> One mpi backend must be installed on the machine (e.g. OpenMPI, MPICH) and find out where the corresponding header file <mpi.h> is located. Then the package can be installed by setting the environment variables CPLUS_INCLUDE_PATH or C_INCLUDE_PATH:

    pip install --upgrade mpi4py