In order to use Cython, we need to install Cython. Enthought and Sage have Cython included. For more information, see http://www.enthought.com/products/epd.php and http://sagemath.org/. We will not discuss here how to install these distributions. Obviously, we need a C compiler to compile the generated C code. On some operating systems, such as Linux, the compiler will already be present. In this recipe, we will assume that you already have the compiler installed.
Cython can be installed using any of the following methods:
.tar
archive): Cython can be installed from tarball by performing the following steps:cd
command.python setup.py install
We can install Cython from the PyPI repository with easy_install cython
or sudo pip install cython
.
We can install Cython on Windows using the unofficial Windows installers from http://www.lfd.uci.edu/~gohlke/pythonlibs/#cython.