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 · 13 comments

Comments

Projects
None yet
9 participants
@chenchen2015

chenchen2015 commented Mar 7, 2018

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

This comment has been minimized.

Member

takluyver commented Mar 8, 2018

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.

@takluyver takluyver closed this Mar 8, 2018

@chenchen2015

This comment has been minimized.

chenchen2015 commented Mar 8, 2018

Good to know, thanks @takluyver

@fterbo

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Member

takluyver commented Apr 3, 2018

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

This comment has been minimized.

edurand commented Apr 3, 2018

@takluyver

This comment has been minimized.

Member

takluyver commented Apr 3, 2018

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

This comment has been minimized.

edurand commented Apr 4, 2018

@wesg52

This comment has been minimized.

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

This comment has been minimized.

Member

takluyver commented Apr 6, 2018

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.

@krish1999

This comment has been minimized.

krish1999 commented Apr 21, 2018

thanks, it solved my problem

dneise added a commit to dneise/ctapipe that referenced this issue Apr 25, 2018

kosack added a commit to cta-observatory/ctapipe that referenced this issue Apr 25, 2018

add script to execute all the ipynbs in the examples/notebooks folder (
…#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

This comment has been minimized.

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

This comment has been minimized.

rohannaidu commented Sep 6, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment