notebook: Jupyter Notebook throws 'IOLoop' AttributeError with tornado=5.0

Observation

After updating to tornado=5.0 using conda update --all -y, jupyter notebook cannot start and was throwing errors:

$ jupyter notebook& 
[1] 3527                                
Traceback (most recent call last):                                                                  
  File "/home/chenchen2015/anaconda3/bin/jupyter-notebook", line 7, in <module>  
    from notebook.notebookapp import main                                        
  File "/home/chenchen2015/anaconda3/lib/python3.6/site-packages/notebook/notebookapp.py", line 45, in <module>                                                    
    ioloop.install()                    
  File "/home/chenchen2015/anaconda3/lib/python3.6/site-packages/zmq/eventloop/ioloop.py", line 210, in install                                                    
    assert (not ioloop.IOLoop.initialized()) or \                                
AttributeError: type object 'IOLoop' has no attribute 'initialized'              

This was seen on Ubuntu 17.10 with Anaconda 5.1.0 x64.

Solution

Similar to #3397, this is solved by manually downgrading back to tornado=4.5.3 with conda install tornado=4.5.3, hence it seems to be a breaking change caused by tornado 5.0 releases

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 30
  • Comments: 15 (4 by maintainers)

Commits related to this issue

Most upvoted comments

You need to upgrade pyzmq to version 17, which is compatible with the new version of Tornado. Anaconda accidentally packaged Tornado 5 before packaging pyzmq 17, but they should have now packaged the latest pyzmq as well.

Hello, I’m having ta similar issue with pyzmq == 17.0.0 and tornado == 5.0.1. To be clear, jupyter is indeed able to start with pyzmq updated. However, as soon as starting a new notebook or restarting an old one, I get: AttributeError: type object ‘ZMQIOLoop’ has no attribute ‘initialized’

Downgrading tornado to 4.5.3 solves the issue. Thanks

I have been having the same issue. I upgraded pyzmq to 17.0.0 globally and the issue has not been solved.

Still a problem on OSX 10.13.6 (17G5019) with pip installed latest versions of everything and only the intended versions/environments for pyzmq/tornado/et al. Downgrading tornado to 4.5.3 still works.

I followed all the update tornado and pyzmq suggestions, still same error in old conda env. I made a fresh conda env - no error. I made the comparison.

conda install jupyter

fixed my old conda env

That probably means that your kernel is running in an environment where you still have an older version of pyzmq, while your notebook is running somewhere with a newer pyzmq.