Jupyter notebook keeps on reconnecting to kernel because of tornado

Recently after I upgraded jupyter notebook on my anaconda distribution, it stops working. Every time it opens a python notebook, it keeps on showing “connecting to kernel” on the top right. The console shows the following error message:

[E 15:45:52.335 NotebookApp] Uncaught exception in /api/kernels/1633c355-600d-4653-b7fd-048fc1697007/channels
 Traceback (most recent call last):
 File "C:\Users\TABLET0006\Anaconda3\lib\site-packages\tornado\websocket.py", line 498, in _run_callback
 result = callback(*args, **kwargs)
 File "C:\Users\TABLET0006\Anaconda3\lib\site-packages\notebook\services\kernels\handlers.py", line 262, in open
 super(ZMQChannelsHandler, self).open()
 File "C:\Users\TABLET0006\Anaconda3\lib\site-packages\notebook\base\zmqhandlers.py", line 176, in open
 self.send_ping, self.ping_interval, io_loop=loop,
 TypeError: __init__() got an unexpected keyword argument 'io_loop'

I searched online, and found that tornado may cause the issues:

https://github.com/tornadoweb/tornado/issues/2015 

So I decided to downgrade tornado to 4.4.3 and it fixed my probem. To downgrade tornado. First, open Anaconda Prompt or your command prompt with python, and type the following:

pip install --ignore-installed tornado=4.4.3

 

 

Advertisements