Here you will find how to set up PyTom on your system

Get the PyTom release

Learn here how you can obtain the source code.

A zipped release

You can download a zipped release file from sourceforge.

Get a direct link into the GIT repository

You can directly hook up into the release repository. This bears the great advantage that you will be able to immediatly install the latest release without having to change your environment. Open a terminal and change into a folder of your choice an run the following command:
git clone pytom
The above line will download the latest stabe (master) branch into the pytom folder. You must not use another folder-name for PyTom assumes it is installed into a "pytom" folder and will not work otherwise.


You will need few other toolboxes installed on your system.

GCCThe Gnu C Compiler
Pythonv2.6 or newer, including development includes and libraries
LXMLPython XML library
libxml2Standard installation with dynamic libs
libxstlStandard installation with dynamic libs
fftw3with float and dynamic library support
boost1.46 - only few headers
swigGlue interface between Python and C/C++
Numpy/SciPyPython scientific library
openmpifor parallel processing
lamfor parallel processing
OPTIONALbut recomended
IPythonInteractive Python
PILPython Image Library
MatPlotLibPython plot library
EpydocPython documentation library

OS specific packages will be listed at OS specific details below.

Tested system setups

Kubuntu Linux

GCC4.4.3 or lower that supports C++ 98 the standard
LXMLPython XML library


GCC4.4.3 or lower that supports C++ 98 the standard



Obtain a PyTom copy and rename the downloaded folder to pytom. Next, change into the pytom/pytomc folder. Know where all your libraries are locate. In case dynamic libraries and include files for the packages mentioned above were not installed into the system specific folder like /usr/include or /lib, you must specify them to the tool. Type

and a help will print all properties you can assign. Specify all paths as parameters to and run it with
--target all
Compilation should succeed ( :) ). Binaries named pytom and ipytom will be written into

You can excecute these files from within this folder or you adjust your shell startup (e.g. ~/.bashrc) to find it automatically for you.

Compile scripts

Kubuntu Linux
--includeDir /usr/include/python2.6 /usr/local/apps/openmpi-1.2.9/include /usr/include/boost/
--libDir /usr/local/apps/openmpi-1.2.9/lib /usr/lib
--dirPath /usr/local/apps/openmpi-1.2.9/bin
--pythonVersion 2.6
--target all

Debian 6
./ --libDir /lib /usr/lib --includeDir /include /usr/include/openmpi/
/usr/include/python2.6 /usr/include/python2.6/numpy/ /usr/include/boost/
--pythonVersion 2.6 --target all

--libDir /opt/local/lib/
--includeDir /opt/local/include/
/opt/local/include/openmpi/ /opt/local/include/boost
--target all

Please note for the Python library and include paths: the path provided here are dependent on the current used Python vesion 2.6.
If you use another version you will have to adjust the version number accordingly.

Setup your environment

Once you successfully compiled PyTom, extend your ~/.bashrc or ~/.cshrc with the path to the PyTom excecuteables:


export PATH '<PathToPyTom>/bin':$PATH


setenv PATH='<PathToPyTom>/bin':$PATH

Check system setup

In order to determine if your system is set up correctly, you can run pytom/pytomc/ A correct PyTom set up should give something like:

swigModules/ (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)
/Users/hrabe/develop/PyTomGIT/master/pytom/pytomc/libs/libtomc/libs/ (compatibility version 0.0.0, current version 0.0.0)
/opt/local/lib/libfftw3.3.dylib (compatibility version 7.0.0, current version 7.0.0)
/opt/local/lib/libfftw3f.3.dylib (compatibility version 7.0.0, current version 7.0.0)
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/Python (compatibility version 2.6.0, current version 2.6.0)
/opt/local/lib/libmpi.1.dylib (compatibility version 2.0.0, current version 2.2.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)

Test the installation by running ipytom (in pytom/bin) and type
import pytom # should not fail
from pytom_volume import read
#should give:
#RuntimeError: : Wrong file format or file doesn't exist!

Congratulations, PyTom is fully installed on your machines!

Packages for OSX

OSX is a unix derivation and PyTom thus runs on these systems. However, you have to install more libraries manually as it is not shipped with the regular Linux tools.

1. Install XCode to get all developer tools like GCC compiler...

2. Install MacPorts to retrieve all these nitty Linux tools (Tested with 2.0.3 and working). You can alternatively use Fink to get these tools (Untested though).

3. Once MacPort is setup, open a terminal and run these scripts:

sudo port selfupdate
sudo port install fftw-3 fftw-3-single
sudo port install libxml2 libxslt
sudo port install python26
sudo port install swig-python
sudo port install py26-lxml
sudo port install openmpi
sudo port install boost
sudo port install py26-pil
sudo port install py26-ipython
sudo port install py26-matplotlib
sudo port install py26-scipy
sudo port install py26-epydoc
After compilation is done (may take some time depending on your machine), you can specify the excecuteable name for python and ipython with
sudo port select --set python python26
sudo port select --set ipython ipython26

because MacPorts does not generate these links automatically.

4.Get PyTom and compile as described above.


Packages for CentOS 6.1 final

Use these commands below to install all required packages for CentOS 6.1 (final release).
sudo yum install fftw-devel.x86_64
sudo yum install boost.x86_64
sudo yum install openmpi.x86_64
sudo yum install openmpi-devel.x86_64
sudo yum install boost.x86_64
sudo yum install boost-devel.x86_64
sudo yum install openmpi-devel.x86_6
sudo yum install openmpi-devel.x86_64
sudo yum install python-devel.x86_64
sudo yum install scipy.x86_64

./ --pythonVersion 2.6 --target all --libDir /usr/lib64/ /usr/lib64/openmpi/lib
--includeDir /usr/include/ /usr/include/python2.6 /usr/include/boost/ /usr/lib64/python2.6/site-packages/numpy/core/include/numpy/ /usr/include/openmpi-x86_64/
--exeDir /usr/lib64/openmpi/bin

Note for compilation of SH Alignment since version 0.95

We are excited to integrate SH Alignment library into PyTom since version 0.95! Now FFTW3 is the only prerequisite. (Migration from FFTW2 to FFTW3 is done.) Once you have it, the compile command stays the same as stated above and SH Alignment will get compiled together with PyTom. After the compilation is finished, you can check if SH Alignment is successfully installed by:

>>> from sh_alignment.frm import frm_align

Core dump error?

After a successful installation you want to use PyTom. However, you still get some core dump errors time to time? Like:

*** glibc detected *** python: free(): invalid pointer: 0x00007f04ffcd64c0 ***
Aborted (core dumped)
Even though, this has nothing to do with PyTom itself. The exception raised from Python is not catched properly and the true error is hidden behind. We suspect this happends due to the Python version. Only 2.6.x has this issue. To avoid this, try to use Python 2.5 or 2.7.


For errors, check our FAQ for known issues.