Skip to content

Instantly share code, notes, and snippets.

@lookis
Last active March 27, 2021 04:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lookis/87bbd6e8d55a016a0e5436f4ebaa2815 to your computer and use it in GitHub Desktop.
Save lookis/87bbd6e8d55a016a0e5436f4ebaa2815 to your computer and use it in GitHub Desktop.
安装 zipline 1.4.1
参考 dockerfile 的安装:
使用 python 3.5.10 (需要补丁)
brew install openssl bzip2 readline
安装 python
CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include" LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix bzip2)/lib"
pyenv install --patch 3.x.x < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch\?full_index\=1)
安装zipline所需库依赖
brew install freetype libpng openblas lapack gfortran hdf5 ta-lib c-blosc
export LDFLAGS="$LDFLAGS -L/usr/local/opt/lapack/lib -L/usr/local/opt/openblas/lib"
export CPPFLAGS="$CPPFLAGS -I/usr/local/opt/openblas/include -I/usr/local/opt/lapack/include"
export BLOSC_DIR=/usr/local/Cellar/c-blosc/1.21.0
然后新建virtualenv,安装python依赖
pip install wheel
pip install cython
pip install 'numpy>=1.11.1,<1.20.0'
pip install 'scipy>=0.17.1,<1.5.0' 'pandas>=0.18.1,<1.0.0' TA-Lib matplotlib jupyter zipline
在python 3.5.10 版本下已经成功
3.6.13 成功
3.7.9 失败
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment