Skip to content

Instantly share code, notes, and snippets.

@DBremen
Last active January 3, 2020 08:32
Show Gist options
  • Select an option

  • Save DBremen/1e8471f8659251116d008e5540bbc705 to your computer and use it in GitHub Desktop.

Select an option

Save DBremen/1e8471f8659251116d008e5540bbc705 to your computer and use it in GitHub Desktop.
How to install use zipline with conda on Windows 10 as of 12/2019

How to install use zipline with conda on Windows 10 as of 12/2019

Downgrade conda

  • conda config --set allow_conda_downgrades true
  • conda install conda=4.6.11

Create new environment with python 3.5 installing necessary modules

  • conda create -n quant python=3.5
  • conda activate env_quant
  • conda install nb_conda jupyter ipykernel tornado=4.5.3 pywin32 matplotlib autopep8 scikit-learn joblib -y -n quant
  • pip install mpl-finance

Install and setup zipline

  • conda install -c Quantopian zipline -y -n quant
  • set QUANDL_API_KEY=YOURAPIKEY
  • zipline ingest -b quandl
  • zipline ingest -b quantopian-quandl

Fix JSONDecodeError due to missing IEXTrading API key see here

  • Sign-up for an API key at https://iexcloud.io/
  • Edit benchmark.py at \Anaconda3\pkgs\zipline-1.3.0-np114py35_0\Lib\site-packages\zipline\data\benchmarks.py
  • Changing the r = requests.get( 'https://api.iextrading.com/1.0/stock/{}/chart/5y'.format(symbol) ) part to
    IIEX_TOKEN = 'APIKEY'
    r = requests.get(
        'https://cloud.iexapis.com/stable/stock/{}/chart/5y?token={}'.format(
            symbol, IEX_TOKEN)
    )
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment