Running "jupyter notebook" in virtualenv returning AttributeError

I installed jupyter using pip in virtualenv in python3. At startup:

jupyter notebook 

I get the following error

  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' 

I updated each dependency module to its latest version using

- update

But he still gives me the same error.

+5
source share
1 answer

I solved this by downgrading the tornado package to version 4.5:

 pip install tornado==4.5 

When I installed ipykernel using pip in my virtual environment, it automatically installed tornado as the latest version. But, I think the latest version of the tornado with the python version below 3.4.4, causing an error.

So, I deleted the tornado and reinstalled it with version 4.5 (this version was installed in my other virtual environment.)

+4
source

Source: https://habr.com/ru/post/1275720/


All Articles