Python Interace

In order to build the python interface, you nee to check out the repository


in particular, the python package lives in


Currently, this has been tested with Python 3.7.4 and gcc 9.1.1-1 on Fedora Linux 30 and requires current numpy 1.15.4 and matplotlib 3.0.2 or better. (Numpy has been fixed to compile KEPLER after Version 1.11.) Ideally, when you import the package, all dependencies should be compiled automatically, however, you need to make sure you us the same directory paths. (…)

Kepler can now be run as a Python module and development is on the way to improve the interface and implement all plot types from Mongo.

Installing the Python Module

This has only been tested for Fedora Linux 22+ so far. First, you need to get a current version of Python, most easy to install locally. As of the time of this writing, this is Version 3.7.0. Earlier versions may have bugs and not work.

First start to make a non-optimised compile to check whether you have all pre-requisites (libraries, header files) installed on your system:

# using bash
export py=3.7.4
tar -xvJf Python-${py}.tar.xz
cd Python-${py}
./configure --prefix=$HOME/Python
make -j


the make -j command may giv you some message of components in python it did not build because of missing dependencies. You should try to find them all to build a complete python install, otherwise some key components may not be build. Specifically, pip3 has happened to be missing in some of the installations I attempted.

Find and install missing dependencies, re-compile until all works.

When this is accomplished, compile and install the full version

make clean
./configure --prefix=$HOME/Python --enable-optimizations --enable-shared
make install

Then, I change my ~/.bashrc to file to include

export PYTHON=${HOME}/Python
export PATH=$PYTHON/bin:$PATH

and open a new bash shell. Now, you want to install a phledora of python packages,

pip3 install -U  --force-reinstall numpy scipy ipython[notebook] psutil pyyaml six matplotlib py-cpuinfo

You will need to install numpy 1.14 or higher (1.14.5 as of this writing), which you may have to check out from the development page and compile/install your self. (Numpy developers kindly included a bug fix to f2py to make KEPLER work.)

By default, it appears current numpy does not create a link for f2py3 by defaul, so we need to make this by hand:

cd Python/bin
ln -s f2py3.? f2py3

If you now create a kepler.code.Kepler object, in an ideal world, this should compile the necessary binary libraries all from scratch.


Please let me know of any problems, their solutions, and possible updates for this documentation

Updating your Python Install

A useful scrtip that I run every now and then to update python is

pip3 install --upgrade pip
pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1  | xargs pip3 install -U
pip3 check

You should coupy this into a file, e.g., update_python and make executable.