Python Implementation

Supported Interpreters

  • Python 2.x


Required Dependencies

Optional Dependencies

Installation of Dependencies on Debian-based Systems

$ sudo apt-get python-setuptools python-dev python-protobuf

Installation of Dependencies on MacOS using Homebrew

For installing RSB and its dependencies from source on Darwin, we recommend to use Homebrew, an easy-to-use package manager for MacOS.

$ brew install cmake boost protobuf

Installation of Dependencies on Windows Systems

Install Microsoft Visual Studio. If you are planning to use the Python implementation of RSB, only version 2008 currently works.

In order to install Spread a source-based installation is required. The visual studio solution for Spread 4.2 is currently broken. Hence only version 4.1 can be used.

In detail, perform the following steps:

  1. Open spread.sln in the win32 folder of the spread archive with Visual Studio.
  2. Set the active configuration to release.
  3. Build libspread and spread. If you build the whole solution errors might appear. However, only the aforementioned artifacts are required.
  4. Optionally, manually copy the generated .lib and .exe to an installation prefix.

Python can be installed using the binary installer. A 32 bit version is recommended.


  1. Clone RSB and its immediate dependencies from the git repository


    “0.15” branch of

    RSB Protocol

    “0.15” branch of

    RSB Python

    “0.15” branch of

  2. Install RSC and the RSB protocol definitions as described in the C++ installation instructions.

  3. Create and edit setup.cfg

    See also

    Setuptools Documentation

    Documentation of the format of the setup.cfg file

    Setuptools does not use command line arguments to configure projects. Instead a file called setup.cfg in the project root is used.

    Add or replace protocolroot in section [proto] with the path to the RSB protocol files (e.g. protocolroot=PREFIX/share/rsbprotocol). An exemplary setup.cfg file could look like this:

    # [existing content here]


    The following RSB-specific options are recognized:

    protoc in section [proto]

    The Google protocol buffers protoc compiler used to generate code from the RSB protocol description. If not specified PATH is used.

    format in section [doc]

    Either html or pdf for the API documentation generation.

    verbose in section [doc]

    Bool flag to control verbose output of the generation tool epydoc.

  4. Start building and installation

    $ export PYTHONPATH=PREFIX/lib/python2.VERSION/site-packages # if you are install to /usr or /usr/local it must be dist-packages
    $ python build
    $ python install --prefix=PREFIX

Adding Support for Spread

Install Spread as described in the C++ installation instructions.

Installation of the Spread module for Python


The Spread Python version automatically installed by setuptools is not working.

  1. Download sources from

  2. Extract the downloaded archive file and change to the SpreadModule-1.5spread4 directory

  3. Edit and set SPREAD_DIR to your installation prefix (e.g., /usr, /your/prefix or c:\code\spread)


    On Windows it might also be necessary to change the following aspects of the

    include_dirs = [SPREAD_DIR + r"\include"],
    library_dirs = [SPREAD_DIR + r"\lib\win32"],
    libraries = ['libspread', 'wsock32'],
    # comment out
    #extra_link_args = ['/NODEFAULTLIB:libcmt'],
  4. Build and install

    $ python build_ext --rpath PREFIX/lib
    $ python install --prefix=PREFIX


    It might be that the --rpath option needs to be removed on Windows.

Testing the Installation

See also

Invoking the Interpreter
How to configure and start the Python interpreter.

The following statement should succeed in a python shell:

import rsb


It may be necessary to set PYTHONPATH to PREFIX/lib/python2.X/site-packages as in the installation step above.