我一直在尝试在OSX 10.11.2上安装zipline。
pip安装失败,出现此错误:
$ pip install zipline
Collecting zipline
Using cached zipline-0.8.3-cp27-none-macosx_10_10_x86_64.whl
Collecting six==1.9.0 (from zipline)
Using cached six-1.9.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): python-dateutil==2.4.2 in /usr/local/lib/python2.7/site-packages (from zipline)
Collecting patsy==0.4.0 (from zipline)
Using cached patsy-0.4.0-py2.py3-none-any.whl
Collecting numexpr==2.4.3 (from zipline)
Using cached numexpr-2.4.3-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting cyordereddict==0.2.2 (from zipline)
Using cached cyordereddict-0.2.2.tar.gz
Collecting bcolz==0.10.0 (from zipline)
Using cached bcolz-0.10.0.tar.gz
Complete output from command python setup.py egg_info:
* Found Cython 0.23.4 package installed.
.. **ERROR:: You need numpy 1.7 or greater to run bcolz!**
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/sj/py2gp2555d15c757mxtpwmn80000gn/T/pip-build-se3cq5/bcolz
我检查了我的numpy版本,它是1.10.2:
$ python
Python 2.7.11 (default, Dec 5 2015, 14:44:53)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.1.76)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.version.version
'1.10.2'
我尝试单独安装bcolz(并且安装成功),但这并没有解决问题。
$ pip install -I zipline
也没有工作。
关于我应该如何安装zipline的任何想法?
编辑:我运行了pip install bcolz
,安装的版本是0.12.1:
/usr/local/lib/python2.7/site-packages/bcolz$ cat version.py
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
version = '0.12.1'
答案 0 :(得分:1)
您未提供的一个信息是您尝试单独安装的bcolz
版本。如果它不是0.10.0,因为zipline要求文件固定bcolz
的版本(参见here),如果安装了更新版本的bcolz(如果你刚刚运行则会出现这种情况) pip install bcolz
),下次安装zipline
的第一件事就是降级bcolz
已安装的版本。
如果您成功安装了0.10.0
的{{1}}版本,则输出的错误必须不同,这样会有所帮助!
[编辑]:所以通过运行bcolz
,您就可以重现同样的问题。看来由于版本比较破坏,bcolz在其0.10.0版本中将无法使用从1.10开始的numpy版本。唯一的解决方案是降级numpy,并ping zipline开发人员,以便他们碰到使用的bcolz版本。
答案 1 :(得分:0)
如果有人遇到同样的问题,请回答我的问题。我最后使用Anacaonda安装了zipline而且效果还不错。包裹的变化是:
The following NEW packages will be INSTALLED:
bcolz: 1.0.0-py27_0
click: 6.6-py27_0
contextlib2: 0.4.0-py27_0
cyordereddict: 0.2.2-py27_0
logbook: 0.12.5-py27_0
zipline: 0.9.0-np19py27_0
The following packages will be UPDATED:
bottleneck: 1.0.0-np110py27_0 --> 1.0.0-np19py27_0
numba: 0.24.0-np110py27_0 --> 0.24.0-np19py27_0
patsy: 0.4.0-np110py27_0 --> 0.4.0-np19py27_0
scipy: 0.17.0-np110py27_0 --> 0.17.0-np19py27_0
statsmodels: 0.6.1-np110py27_0 --> 0.6.1-np19py27_0
The following packages will be DOWNGRADED:
anaconda: 4.0.0-np110py27_0 --> custom-py27_0
astropy: 1.1.2-np110py27_0 --> 1.0.4-np19py27_0
h5py: 2.5.0-np110py27_4 --> 2.5.0-np19py27_3
matplotlib: 1.5.1-np110py27_0 --> 1.4.3-np19py27_3
numexpr: 2.5-np110py27_0 --> 2.4.6-np19py27_0
numpy: 1.10.4-py27_0 --> 1.9.3-py27_1
pandas: 0.18.0-np110py27_0 --> 0.16.2-np19py27_0
pytables: 3.2.2-np110py27_1 --> 3.2.2-np19py27_0
scikit-image: 0.12.3-np110py27_0 --> 0.11.3-np19py27_0
scikit-learn: 0.17.1-np110py27_0 --> 0.16.1-np19py27_0
答案 2 :(得分:0)
一直有完全相同的问题。只是为了补充答案。这是对我有用的终端命令:conda install -c quantopian zipline=1.0.2