Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get RuntimeWarning when running Jupyter notebook and never connects to Kernel

I have a fresh install of python 3.7.2 and pip installed jupyter 4.4.0 in a fresh venv on Windows 7.0 professional. I started a Jupyter notebook and my notebook never connects to the kernel. On the command prompt, I see this error:

[I 17:41:11.959 NotebookApp] Kernel started: 35b03148-7d3e-48cb-a270-ebe959012d98
[I 17:41:14.307 NotebookApp] Adapting to protocol v5.1 for kernel 35b03148-7d3e-48cb-a270-ebe959012d98
<full path masked>...\py372venv\lib\site-packages\notebook\base\zmqhandlers.py:284: RuntimeWarning: coroutine 'WebSocketHandler.get' was never awaited
  super(AuthenticatedZMQStreamHandler, self).get(*args, **kwargs)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
[W 17:41:15.404 NotebookApp] Replacing stale connection: 35b03148-7d3e-48cb-a270-ebe959012d98:3b9a037fced84ccc891192e2f387bae0
[W 17:41:37.415 NotebookApp] Replacing stale connection: 35b03148-7d3e-48cb-a270-ebe959012d98:3b9a037fced84ccc891192e2f387bae0
[W 17:42:01.421 NotebookApp] Replacing stale connection: 35b03148-7d3e-48cb-a270-ebe959012d98:3b9a037fced84ccc891192e2f387bae0
[W 17:42:29.468 NotebookApp] Replacing stale connection: 35b03148-7d3e-48cb-a270-ebe959012d98:3b9a037fced84ccc891192e2f387bae0
[W 17:43:05.489 NotebookApp] Replacing stale connection: 35b03148-7d3e-48cb-a270-ebe959012d98:3b9a037fced84ccc891192e2f387bae0

These replacing stale connection messages continue. What could be the issue? I am new to Jupyter and a bit less new to Python.

like image 299
user2340639 Avatar asked Mar 05 '19 01:03

user2340639


1 Answers

Try to downgrade tornado version (pip install 'tornado<6'), as described there: https://github.com/jupyter/notebook/issues/4437#issuecomment-468758440

For me, downgrading from 6.0.1 to 5.1.1 solved the issue with jupyter not connecting to kernel.

like image 113
Grigory Serebryakov Avatar answered Nov 04 '22 15:11

Grigory Serebryakov