Skip to content

Installing PySlurm

Giovanni Torres edited this page Jan 31, 2018 · 2 revisions

Install Cython

PySlurm requires Cython to compile. There are a few ways to get Cython on your system:

Install Cython from the package repositories

On RedHat/CentOS:

sudo yum install Cython

On Fedora:

sudo dnf install Cython

On Debian/Ubuntu:

sudo apt-get install Cython

Install Cython in a Python Virtual Environment

Create a virtual environment called pyslurmenv:

virtualenv pyslurmenv

Activate the new virtual environment and install Cython:

source pyslurmenv/bin/activate
pip install Cython

Install PySlurm

Assuming Slurm libraries and headers are installed in the usual locations (/usr/include, /usr/lib64), compile PySlurm with the following command:

python setup.py build

If the Slurm libraries and headers are in the non-default location, use one or both of the following flags to specify the locations:

python setup.py build --slurm-lib=/path/to/libslurm --slurm-inc=/path/to/slurmheader

To install pyslurm globally on the system, use sudo:

sudo python setup.py install

To install pyslurm inside the virtual environment, sudo is not required:

python setup.py install