安装成功后无法导入 Zipline 包

Cannot import Zipline package after successful installation

我正在使用 python3.6 和 anaconda3。我已经使用命令 pip install zipline

成功安装了 zipline
~$ pip install zipline
Collecting zipline
Requirement already satisfied: multipledispatch>=0.4.8 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: Mako>=1.0.1 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: pandas<0.19,>=0.18.1 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: tables>=3.3.0 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: pip>=7.1.0 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: MarkupSafe>=0.23 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: bottleneck>=1.0.0 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: scipy>=0.17.1 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: decorator>=4.0.0 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: setuptools>18.0 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: toolz>=0.8.2 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: python-dateutil>=2.4.2 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: numexpr>=2.6.1 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: patsy>=0.4.0 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: numpy>=1.11.1 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: click>=4.0.0 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: alembic>=0.7.7 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: Cython>=0.25.2 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: sortedcontainers>=1.4.4 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: requests>=2.9.1 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: sqlalchemy>=1.0.8 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: bcolz<1,>=0.12.1 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: six>=1.10.0 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: pandas-datareader<0.6,>=0.2.1 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: lru-dict>=1.1.4 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: networkx<2.0,>=1.9.1 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: intervaltree>=2.1.0 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: empyrical>=0.4.2 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: contextlib2>=0.4.0 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: statsmodels>=0.6.1 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: Logbook>=0.12.5 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: pytz>=2016.4 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: cyordereddict>=0.2.2 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: requests-file>=1.4.1 in ./anaconda3/lib/python3.6/site-packages (from zipline)
Requirement already satisfied: python-editor>=0.3 in ./anaconda3/lib/python3.6/site-packages (from alembic>=0.7.7->zipline)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./anaconda3/lib/python3.6/site-packages (from requests>=2.9.1->zipline)
Requirement already satisfied: idna<2.7,>=2.5 in ./anaconda3/lib/python3.6/site-packages (from requests>=2.9.1->zipline)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in ./anaconda3/lib/python3.6/site-packages (from requests>=2.9.1->zipline)
Requirement already satisfied: certifi>=2017.4.17 in ./anaconda3/lib/python3.6/site-packages (from requests>=2.9.1->zipline)
Requirement already satisfied: requests-ftp in ./anaconda3/lib/python3.6/site-packages (from pandas-datareader<0.6,>=0.2.1->zipline)
Installing collected packages: zipline
Successfully installed zipline-1.2.0

但是,安装后,当我运行以下代码时出现错误。

import zipline as zp
print(zp.__version__)

.

Traceback (most recent call last):
  File "/Users/chunyinwong/Documents/PycharmProjects/IB/ziplinetut.py", line 1, in <module>
    import zipline as zp
  File "/anaconda3/lib/python3.6/site-packages/zipline/__init__.py", line 20, in <module>
    from . import data
  File "/anaconda3/lib/python3.6/site-packages/zipline/data/__init__.py", line 1, in <module>
    from . import loader
  File "/anaconda3/lib/python3.6/site-packages/zipline/data/loader.py", line 17, in <module>
    import logbook
  File "/anaconda3/lib/python3.6/site-packages/logbook/__init__.py", line 14, in <module>
    from .base import (
  File "/anaconda3/lib/python3.6/site-packages/logbook/base.py", line 19, in <module>
    from logbook.concurrency import (greenlet_get_ident, thread_get_ident,
ImportError: cannot import name 'thread_get_ident'

Process finished with exit code 1

我已经尝试 运行 在 Jupyter notebook 和 Pycharm 上使用相同的代码,但结果相同。

感谢任何帮助:)

logbook更新到最新版本

由于航海日志已过时,无法导入greenlet_get_ident, thread_get_ident