Install¶
Installing with Amazon Linux
¶
This software has only been installed on Amazon Linux, running under Amazon Workspaces.
We give a enclosed script to install miniconda3 and setup a virtual environment. Then use pip to install remaining dependencies.
It always works best to try and install conda versions of modules first, then use pip only if there is no other way to install needed modules. The reason for this is that pip will force-install dependencies and destroy system compatibility. On the other hand, Conda installs preserve dependencies as much as possible, and gives the choice of refusing the upgrade, and all a back-out of the upgrades, if made.
Installing with conda
¶
Another way to install Zipline 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 Zipline and its dependencies
without requiring the use of a second tool to acquire Zipline’s non-Python
dependencies.
For instructions on how to install conda
, see the Conda Installation
Documentation
Managing conda
environments¶
It is recommended to install Zipline in an isolated conda
environment.
Installing Zipline in conda
environments will not interfere your default
Python deployment or site-packages, which will prevent any possible conflict
with your global libraries. For more information on conda
environment, see
the Conda User Guide
Assuming conda
has been set up, you can create a conda
environment:
Python 3.6:
$ conda create -n hca python=3.6
Now you have set up an isolated environment called hca
, a sandbox-like
structure to install Zipline. Then you should activate the conda environment
by using the command
$ conda activate hca
To deactivate the conda
environment:
(hca) $ conda deactivate
We have condensed all this into scripts, that also includes installing jupyterlab/jupyter. This content is also on the README.rst page of the repo.
Install Scripts¶
Clone this repository into your $HOME directory: git clone https://github.com/hotchilianalytics/zipline-broker.git
The install scripts are located at the location:
zipline-broker/install
. In an AWS Linux environment, without miniconda installed, execute the script:. $HOME/zipline-broker/install/install_conda_zipline-broker.sh
Logout and log back in. You should see an hca prompt, which means that you are in the proper conda environment. Install jupyterlab/jupyter so that you can run the notebooks. To do this, run:
. $HOME/zipline-broker/install/config_new_user.sh
Fire off jupyterlab and navigate to $HOME/hca/hca-resources. Choose one of the examples, click on it and pop up the enclosed .ipynb file(not the tearsheet one) to get started.