Installing Cython

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.

How to do it...

Cython can be installed using any of the following methods:

  • Installing from tarball (.tar archive): Cython can be installed from tarball by performing the following steps:
    1. Download a tarball from http://cython.org/#download.
    2. Unpack it.
    3. Browse to the directory using the cd command.
    4. Run the following command:
      python setup.py install
  • Installing with setup tools or pip

    We can install Cython from the PyPI repository with easy_install cython or sudo pip install cython.

  • Installing with Windows installers

    We can install Cython on Windows using the unofficial Windows installers from http://www.lfd.uci.edu/~gohlke/pythonlibs/#cython.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset