Skip to content

Using latest version of Cython

Giovanni Torres edited this page Aug 19, 2017 · 1 revision

The versions of Cython available from the repositories are likely to be older than the latest available release. Often times it is quite older and can cause issues when Cython attempts to cythonize pyslurm.pyx to pyslurm.c. Most of the PySlurm development uses the latest version of Cython.

To install the latest version of Cython from PyPi, run:

sudo pip install Cython

If you already have a version of Cython installed and would like to upgrade to the lastest, run:

sudo pip install --upgrade Cython

If you prefer not to alter the current installation of Cython, whether it was installed from PyPi or from the repositories, you may install elsewhere, for example:

cd /home/giovanni
curl -L https://github.com/cython/cython/archive/0.23.4.tar.gz | tar xz

This will download and extract Cython version 0.23.4 to /home/giovanni/cython-0.23.4. The binaries in the cython bin directory are static executables. Therefore, you will only need to adjust two path's in order to compile PySlurm:

export PYTHONPATH=/home/giovanni/cython-0.23.4:$PYTHONPATH
export PATH=/home/giovanni/cython-0.23.4/bin:$PATH

Notice that the first path only includes the path to the cython directory and the second includes the bin/ subdirectory within the cython directory.