Install

Installing with pip

Installing Catalyst via pip is slightly more involved than the average Python package.

There are two reasons for the additional complexity:

  1. Catalyst ships several C extensions that require access to the CPython C API. In order to build the C extensions, pip needs access to the CPython header files for your Python installation.
  2. Zipline depends on numpy, the core library for numerical array computing in Python. Numpy depends on having the LAPACK linear algebra routines available.

Because LAPACK and the CPython headers are non-Python dependencies, the correct way to install them varies from platform to platform. If you’d rather use a single tool to install Python and non-Python dependencies, or if you’re already using Anaconda as your Python distribution, you can skip to the Installing with Conda section.

Once you’ve installed the necessary additional dependencies (see below for your particular platform), you should be able to simply run

$ pip install enigma-catalyst

If you use Python for anything other than Catalyst, we strongly recommend that you install in a virtualenv. The Hitchhiker’s Guide to Python provides an excellent tutorial on virtualenv. Here’s a summarized version:

$ virtualenv catalyst-venv
$ source ./catalyst-venv/bin/activate
$ pip install enigma-catalyst

GNU/Linux

On Debian-derived Linux distributions, you can acquire all the necessary binary dependencies from apt by running:

$ sudo apt-get install libatlas-base-dev python-dev gfortran pkg-config libfreetype6-dev

On recent RHEL-derived derived Linux distributions (e.g. Fedora), the following should be sufficient to acquire the necessary additional dependencies:

$ sudo dnf install atlas-devel gcc-c++ gcc-gfortran libgfortran python-devel redhat-rep-config

On Arch Linux, you can acquire the additional dependencies via pacman:

$ pacman -S lapack gcc gcc-fortran pkg-config

OSX

The version of Python shipped with OSX by default is generally out of date, and has a number of quirks because it’s used directly by the operating system. For these reasons, many developers choose to install and use a separate Python installation. The Hitchhiker’s Guide to Python provides an excellent guide to Installing Python on OSX, which explains how to install Python with the Homebrew manager.

Assuming you’ve installed Python with Homebrew, you’ll also likely need the following brew packages:

$ brew install freetype pkg-config gcc openssl

Windows

For windows, the easiest and best supported way to install zipline is to use Conda.

Installing with conda

Another way to install Catalyst is via the conda package manager, which comes as part of Continuum Analytics’ Anaconda distribution.

The primary advantage of using Conda over pip is that conda natively understands the complex binary dependencies of packages like numpy and scipy. This means that conda can install Catalyst and its dependencies without requiring the use of a second tool to acquire Catalyst’s non-Python dependencies.

For instructions on how to install conda, see the Conda Installation Documentation

Once conda has been set up you can install Catalyst from our Quantopian channel:

conda install -c Quantopian zipline