Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jupyter Notebook throws 'IOLoop' AttributeError with tornado=5.0 #3407

Closed
chenchen2015 opened this issue Mar 7, 2018 · 15 comments
Closed

Jupyter Notebook throws 'IOLoop' AttributeError with tornado=5.0 #3407

chenchen2015 opened this issue Mar 7, 2018 · 15 comments

Comments

@chenchen2015
Copy link

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

@takluyver
Copy link
Member

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.

@chenchen2015
Copy link
Author

Good to know, thanks @takluyver

@fterbo
Copy link

fterbo commented Mar 20, 2018

To be clear, our case was not anaconda, and it was getting everything on a fresh install from pip. We do not install pyzmq or tornado directly (although installing tornado directly did fix it).

@edurand
Copy link

edurand commented Apr 3, 2018

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

@takluyver
Copy link
Member

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.

@edurand
Copy link

edurand commented Apr 3, 2018 via email

@takluyver
Copy link
Member

Use jupyter kernelspec list to see where your kernelspecs are. That shows you some folders - inside each one should be a kernel.json file pointing to which executable that kernelspec will use.

If there's an entry which ends with ipykernel/resources, then it won't have a kernel.json, and that kernel type will be launched with the same Python that the notebook server runs on.

@edurand
Copy link

edurand commented Apr 4, 2018 via email

@wesg52
Copy link

wesg52 commented Apr 6, 2018

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

@takluyver
Copy link
Member

If you're getting the same traceback as in the original post, then it must be using an older version of pyzmq somewhere. Check for different virtualenvs/conda envs/Python versions.

@khadkakrishna
Copy link

thanks, it solved my problem

dneise pushed a commit to dneise/ctapipe that referenced this issue Apr 25, 2018
kosack pushed a commit to cta-observatory/ctapipe that referenced this issue Apr 25, 2018
…#724)

* add script to execute all the ipynbs in the examples/notebooks folder

* directly exectute with jupyter-nbconvert --execute; timeout=60

* test in alphabetical order

* a bit of docu

* downgrade tornado for the moment ... c.f. jupyter/notebook#3407

* fix NameError: get_dataset_path

* fix AttrbuteError: dl1 has no waveform

* fix Timeout Error, set maxevents to 30

* increase timeout to 2min

* h5py is needed for the notebooks

* more features: xfail, dot-line, capture output at the end

 - allow to exclude known failing notebooks (xfail)
 - print the typical pytest dots while testing (dot-line)
 - print the stderr of failing tests (and xfails) at the end

* decode output correctly

* move functions around

* no need to set brainstorm to xfail, it was removed in the meantime

* double the timeout

* replace " with '
@minrk minrk added this to the Not Notebook milestone Jun 15, 2018
@ajgpitch
Copy link

ajgpitch commented Jul 8, 2018

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

@rohannaidu
Copy link

Upgrading pyzmq didn't work for me, but as a few other recent comments here have mentioned, downgrading tornado did it!

@jsutch
Copy link

jsutch commented Feb 10, 2019

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.

@rafiulgits
Copy link

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

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests