正在运行" jupyter notebook"在virtualenv中返回AttributeError

时间:2018-03-06 04:16:37

标签: pip jupyter-notebook python-3.4

我在python3的virtualenv中使用pip安装了jupyter。在跑步时:

jupyter notebook

我收到以下错误

    File "<path>/ss/bin/jupyter-notebook", line 7, in <module>
    from notebook.notebookapp import main
  File "<path>/ss/lib/python3.4/site-packages/notebook/notebookapp.py", line 44, in <module>
    from zmq.eventloop import ioloop
  File "<path>/ss/lib/python3.4/site-packages/zmq/eventloop/__init__.py", line 3, in <module>
    from zmq.eventloop.ioloop import IOLoop
  File "<path>/ss/lib/python3.4/site-packages/zmq/eventloop/ioloop.py", line 78, in <module>
    while _IOLoop.configurable_default() is not _IOLoop:
  File "<path>/ss/lib/python3.4/site-packages/tornado/ioloop.py", line 350, in configurable_default
    from tornado.platform.asyncio import AsyncIOLoop
  File "<path>/ss/lib/python3.4/site-packages/tornado/platform/asyncio.py", line 25, in <module>
    from tornado.gen import convert_yielded
  File "<path>/ss/lib/python3.4/site-packages/tornado/gen.py", line 1295, in <module>
    _wrap_awaitable = asyncio.ensure_future
AttributeError: 'module' object has no attribute 'ensure_future'

我使用

将每个依赖模块升级到最新版本
  

- 升级

但它仍然给我同样的错误。

1 个答案:

答案 0 :(得分:7)

我通过将龙卷风软件包降级到版本4.5来解决这个问题:

pip install tornado==4.5

当我在我的虚拟环境中使用pip安装ipykernel时,它会自动安装龙卷风作为最新版本。但是,我认为最新版本的龙卷风与python版本低于3.4.4导致错误。

所以,我删除了龙卷风并用4.5版重新安装(此版本安装在我的其他虚拟环境中。)