Windows
For windows, the easiest and best supported way to install zipline is to use Conda.
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
Once conda has been set up you can install Zipline from our Quantopian channel:
conda install -c Quantopian zipline
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 env_zipline python=3.6
Now you have set up an isolated environment called env_zipline, a sandbox-like structure to install Zipline. Then you should activate the conda environment by using the command
$ source activate env_zipline
You can install Zipline by running
(env_zipline) $ conda install -c Quantopian zipline
To deactivate the conda environment:
(env_zipline) $ source deactivate
(base) C:\Users\Administrator>conda create -n btcquant python=3.6 Solving environment: done ==> WARNING: A newer version of conda exists. <== current version: 4.5.1 latest version: 4.5.3 Please update conda by running $ conda update -n base conda ## Package Plan ## environment location: D:\Miniconda3\envs\btcquant added / updated specs: - python=3.6 The following packages will be downloaded: package | build ---------------------------|----------------- pip-10.0.1 | py36_0 1.8 MB setuptools-39.1.0 | py36_0 570 KB ------------------------------------------------------------ Total: 2.4 MB The following NEW packages will be INSTALLED: certifi: 2018.4.16-py36_0 pip: 10.0.1-py36_0 python: 3.6.5-h0c2934d_0 setuptools: 39.1.0-py36_0 vc: 14-h0510ff6_3 vs2015_runtime: 14.0.25123-3 wheel: 0.31.0-py36_0 wincertstore: 0.2-py36h7fe50ca_0 Proceed ([y]/n)? Downloading and Extracting Packages pip 10.0.1############################################################# | 100% setuptools 39.1.0###################################################### | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done # # To activate this environment, use # # $ conda activate btcquant # # To deactivate an active environment, use # # $ conda deactivate (base) C:\Users\Administrator>conda activate btcquant (btcquant) C:\Users\Administrator>conda install -c Quantopian zipline Solving environment: done ==> WARNING: A newer version of conda exists. <== current version: 4.5.1 latest version: 4.5.3 Please update conda by running $ conda update -n base conda ## Package Plan ## environment location: D:\Miniconda3\envs\btcquant added / updated specs: - zipline The following packages will be downloaded: package | build ---------------------------|----------------- mkl-2018.0.2 | 1 176.6 MB requests-ftp-0.3.1 | py35_0 14 KB hdf5-1.10.1 | h98b8871_1 33.4 MB bzip2-1.0.6 | hbe05fcf_4 144 KB win_inet_pton-1.0.1 | py35hbef1270_1 5 KB wheel-0.31.0 | py35_0 81 KB toolz-0.9.0 | py35_0 93 KB pysocks-1.6.8 | py35_0 23 KB scipy-1.1.0 | py35h672f292_0 13.5 MB decorator-4.3.0 | py35_0 16 KB pyopenssl-17.5.0 | py35h75c5b16_0 79 KB click-6.7 | py35h10df73f_0 105 KB networkx-1.11 | py35h097edc8_0 1.5 MB alembic-0.7.7 | py35_0 206 KB Quantopian requests-file-1.4.3 | py35_0 8 KB empyrical-0.4.2 | py35_0 55 KB Quantopian logbook-0.12.5 | py35_0 119 KB Quantopian blosc-1.14.3 | he51fdeb_0 652 KB pytz-2018.4 | py35_0 214 KB wincertstore-0.2 | py35hfebbdb8_0 13 KB pytables-3.4.3 | py35he6f6034_0 2.7 MB intervaltree-2.1.0 | py35_0 46 KB Quantopian urllib3-1.22 | py35h8cc84eb_0 155 KB certifi-2018.4.16 | py35_0 143 KB python-3.5.5 | h0c2934d_2 18.2 MB bcolz-0.12.1 | np111py35_0 302 KB Quantopian cffi-1.11.5 | py35h945400d_0 215 KB sqlalchemy-1.2.7 | py35ha85dd04_0 1.6 MB setuptools-39.1.0 | py35_0 592 KB pip-10.0.1 | py35_0 1.8 MB lzo-2.10 | h6df0209_2 154 KB idna-2.6 | py35h8dcb9ae_1 123 KB patsy-0.5.0 | py35_0 322 KB cryptography-2.2.2 | py35hfa6e2cd_0 518 KB pandas-datareader-0.5.0 | py35_0 103 KB lru-dict-1.1.4 | py35_0 11 KB Quantopian contextlib2-0.5.5 | py35h0a97e54_0 15 KB asn1crypto-0.24.0 | py35_0 156 KB chardet-3.0.4 | py35h177e1b7_1 210 KB numpy-1.11.3 | py35h4a99626_4 3.4 MB sortedcontainers-1.5.10 | py35_0 47 KB cython-0.28.2 | py35hfa6e2cd_0 2.7 MB statsmodels-0.8.0 | py35hfa6034c_0 6.3 MB python-dateutil-2.7.2 | py35_0 257 KB snappy-1.1.7 | h777316e_3 82 KB numexpr-2.6.5 | py35hcd2f87e_0 128 KB intel-openmp-2018.0.0 | 8 1.4 MB multipledispatch-0.5.0 | py35_0 18 KB cyordereddict-0.2.2 | py35_0 39 KB Quantopian requests-2.18.4 | py35h54a615f_1 92 KB six-1.11.0 | py35hc1da2df_1 21 KB zlib-1.2.11 | h8395fce_2 237 KB pandas-0.18.1 | np111py35_0 6.9 MB zipline-1.2.0 | np111py35_0 1.4 MB Quantopian icc_rt-2017.0.4 | h97af966_0 8.0 MB bottleneck-1.2.1 | py35h8a3671c_0 113 KB markupsafe-1.0 | py35hc253e08_1 27 KB pycparser-2.18 | py35h15a15da_1 170 KB mako-1.0.7 | py35ha146b58_0 135 KB ------------------------------------------------------------ Total: 285.5 MB The following NEW packages will be INSTALLED: alembic: 0.7.7-py35_0 Quantopian asn1crypto: 0.24.0-py35_0 bcolz: 0.12.1-np111py35_0 Quantopian blosc: 1.14.3-he51fdeb_0 bottleneck: 1.2.1-py35h8a3671c_0 bzip2: 1.0.6-hbe05fcf_4 ca-certificates: 2018.03.07-0 cffi: 1.11.5-py35h945400d_0 chardet: 3.0.4-py35h177e1b7_1 click: 6.7-py35h10df73f_0 contextlib2: 0.5.5-py35h0a97e54_0 cryptography: 2.2.2-py35hfa6e2cd_0 cyordereddict: 0.2.2-py35_0 Quantopian cython: 0.28.2-py35hfa6e2cd_0 decorator: 4.3.0-py35_0 empyrical: 0.4.2-py35_0 Quantopian hdf5: 1.10.1-h98b8871_1 icc_rt: 2017.0.4-h97af966_0 idna: 2.6-py35h8dcb9ae_1 intel-openmp: 2018.0.0-8 intervaltree: 2.1.0-py35_0 Quantopian logbook: 0.12.5-py35_0 Quantopian lru-dict: 1.1.4-py35_0 Quantopian lzo: 2.10-h6df0209_2 mako: 1.0.7-py35ha146b58_0 markupsafe: 1.0-py35hc253e08_1 mkl: 2018.0.2-1 multipledispatch: 0.5.0-py35_0 networkx: 1.11-py35h097edc8_0 numexpr: 2.6.5-py35hcd2f87e_0 numpy: 1.11.3-py35h4a99626_4 openssl: 1.0.2o-h8ea7d77_0 pandas: 0.18.1-np111py35_0 pandas-datareader: 0.5.0-py35_0 patsy: 0.5.0-py35_0 pycparser: 2.18-py35h15a15da_1 pyopenssl: 17.5.0-py35h75c5b16_0 pysocks: 1.6.8-py35_0 pytables: 3.4.3-py35he6f6034_0 python-dateutil: 2.7.2-py35_0 pytz: 2018.4-py35_0 requests: 2.18.4-py35h54a615f_1 requests-file: 1.4.3-py35_0 requests-ftp: 0.3.1-py35_0 scipy: 1.1.0-py35h672f292_0 six: 1.11.0-py35hc1da2df_1 snappy: 1.1.7-h777316e_3 sortedcontainers: 1.5.10-py35_0 sqlalchemy: 1.2.7-py35ha85dd04_0 statsmodels: 0.8.0-py35hfa6034c_0 toolz: 0.9.0-py35_0 urllib3: 1.22-py35h8cc84eb_0 win_inet_pton: 1.0.1-py35hbef1270_1 zipline: 1.2.0-np111py35_0 Quantopian zlib: 1.2.11-h8395fce_2 The following packages will be UPDATED: certifi: 2018.4.16-py36_0 --> 2018.4.16-py35_0 pip: 10.0.1-py36_0 --> 10.0.1-py35_0 setuptools: 39.1.0-py36_0 --> 39.1.0-py35_0 wheel: 0.31.0-py36_0 --> 0.31.0-py35_0 wincertstore: 0.2-py36h7fe50ca_0 --> 0.2-py35hfebbdb8_0 The following packages will be DOWNGRADED: python: 3.6.5-h0c2934d_0 --> 3.5.5-h0c2934d_2 Proceed ([y]/n)? Downloading and Extracting Packages mkl 2018.0.2########################################################### | 100% requests-ftp 0.3.1##################################################### | 100% hdf5 1.10.1############################################################ | 100% bzip2 1.0.6############################################################ | 100% win_inet_pton 1.0.1#################################################### | 100% wheel 0.31.0########################################################### | 100% toolz 0.9.0############################################################ | 100% pysocks 1.6.8########################################################## | 100% scipy 1.1.0############################################################ | 100% decorator 4.3.0######################################################## | 100% pyopenssl 17.5.0####################################################### | 100% click 6.7############################################################## | 100% networkx 1.11########################################################## | 100% alembic 0.7.7########################################################## | 100% requests-file 1.4.3#################################################### | 100% empyrical 0.4.2######################################################## | 100% logbook 0.12.5######################################################### | 100% blosc 1.14.3########################################################### | 100% pytz 2018.4############################################################ | 100% wincertstore 0.2####################################################### | 100% pytables 3.4.3######################################################### | 100% intervaltree 2.1.0##################################################### | 100% urllib3 1.22########################################################### | 100% certifi 2018.4.16###################################################### | 100% python 3.5.5########################################################### | 100% bcolz 0.12.1########################################################### | 100% cffi 1.11.5############################################################ | 100% sqlalchemy 1.2.7####################################################### | 100% setuptools 39.1.0###################################################### | 100% pip 10.0.1############################################################# | 100% lzo 2.10############################################################### | 100% idna 2.6############################################################### | 100% patsy 0.5.0############################################################ | 100% cryptography 2.2.2##################################################### | 100% pandas-datareader 0.5.0################################################ | 100% lru-dict 1.1.4######################################################### | 100% contextlib2 0.5.5###################################################### | 100% asn1crypto 0.24.0###################################################### | 100% chardet 3.0.4########################################################## | 100% numpy 1.11.3########################################################### | 100% sortedcontainers 1.5.10################################################ | 100% cython 0.28.2########################################################## | 100% statsmodels 0.8.0###################################################### | 100% python-dateutil 2.7.2################################################## | 100% snappy 1.1.7########################################################### | 100% numexpr 2.6.5########################################################## | 100% intel-openmp 2018.0.0################################################## | 100% multipledispatch 0.5.0################################################# | 100% cyordereddict 0.2.2#################################################### | 100% requests 2.18.4######################################################## | 100% six 1.11.0############################################################# | 100% zlib 1.2.11############################################################ | 100% pandas 0.18.1########################################################## | 100% zipline 1.2.0########################################################## | 100% icc_rt 2017.0.4######################################################## | 100% bottleneck 1.2.1####################################################### | 100% markupsafe 1.0######################################################### | 100% pycparser 2.18######################################################### | 100% mako 1.0.7############################################################# | 100% Preparing transaction: done Verifying transaction: done Executing transaction: done (btcquant) C:\Users\Administrator>