After installing jupyter in Ubuntu 18.04, the notebook would get stuck with the message "connecting to kernel", but never actually connecting. After following some StackOverflow advice, I downgraded tornado to a lower version than 6, which solved the problem for many users. Now my notebook connects and disconnects right afterward, and then connects again to disconnect right after. I updated and upgraded every package and the browser (I'm using chrome, but the other browsers gave the same issue).
cohen@Surface:~$ jupyter notebook[I 18:18:10.561 NotebookApp] Serving notebooks from local directory: /home/cohen[I 18:18:10.562 NotebookApp] 0 active kernels[I 18:18:10.562 NotebookApp] The Jupyter Notebook is running at:[I 18:18:10.563 NotebookApp] http://localhost:8888/?token=86055fa9a8912f1da959db9ad89697d1dbbafc13aa2a3410[I 18:18:10.563 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).[C 18:18:10.577 NotebookApp] Copy/paste this URL into your browser when you connect for the first time, to login with a token: http://localhost:8888/?token=86055fa9a8912f1da959db9ad89697d1dbbafc13aa2a3410[I 18:18:11.986 NotebookApp] Accepting one-time-token-authenticated connection from 127.0.0.1[W 18:18:12.770 NotebookApp] 404 GET /static/components/moment/locale/es-es.js?v=20220525181809 (127.0.0.1) 7.36ms referer=http://localhost:8888/tree/usr/lib/python3.6/json/encoder.py:257: UserWarning: date_default is deprecated since jupyter_client 7.0.0. Use jupyter_client.jsonutil.json_default. return _iterencode(o, 0)[I 18:18:28.175 NotebookApp] 302 GET /tree (127.0.0.1) 0.93ms[I 18:18:39.490 NotebookApp] 302 GET /?token=86055fa9a8912f1da959db9ad89697d1dbbafc13aa2a3410 (127.0.0.1) 0.76ms[I 18:18:44.078 NotebookApp] Kernel started: 44f28b4c-ecbd-4cfa-b88d-1504b55bebd3[E 18:18:45.238 NotebookApp] Uncaught exception GET /api/kernels/44f28b4c-ecbd-4cfa-b88d-1504b55bebd3/channels?session_id=0E453CCA133540FEB36DE62324C09F20 (127.0.0.1) HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/kernels/44f28b4c-ecbd-4cfa-b88d-1504b55bebd3/channels?session_id=0E453CCA133540FEB36DE62324C09F20', version='HTTP/1.1', remote_ip='127.0.0.1') Traceback (most recent call last): File "/home/cohen/.local/lib/python3.6/site-packages/tornado/websocket.py", line 546, in _run_callback result = callback(*args, **kwargs) File "/usr/lib/python3/dist-packages/notebook/services/kernels/handlers.py", line 258, in open super(ZMQChannelsHandler, self).open() File "/usr/lib/python3/dist-packages/notebook/base/zmqhandlers.py", line 168, in open self.send_ping, self.ping_interval, io_loop=loop, TypeError: __init__() got an unexpected keyword argument 'io_loop'[E 18:18:46.583 NotebookApp] Uncaught exception GET /api/kernels/44f28b4c-ecbd-4cfa-b88d-1504b55bebd3/channels?session_id=0E453CCA133540FEB36DE62324C09F20 (127.0.0.1) HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/kernels/44f28b4c-ecbd-4cfa-b88d-1504b55bebd3/channels?session_id=0E453CCA133540FEB36DE62324C09F20', version='HTTP/1.1', remote_ip='127.0.0.1') Traceback (most recent call last): File "/home/cohen/.local/lib/python3.6/site-packages/tornado/websocket.py", line 546, in _run_callback result = callback(*args, **kwargs) File "/usr/lib/python3/dist-packages/notebook/services/kernels/handlers.py", line 258, in open super(ZMQChannelsHandler, self).open() File "/usr/lib/python3/dist-packages/notebook/base/zmqhandlers.py", line 168, in open self.send_ping, self.ping_interval, io_loop=loop, TypeError: __init__() got an unexpected keyword argument 'io_loop'[E 18:18:47.943 NotebookApp] Uncaught exception GET /api/kernels/44f28b4c-ecbd-4cfa-b88d-1504b55bebd3/channels?session_id=0E453CCA133540FEB36DE62324C09F20 (127.0.0.1) HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/kernels/44f28b4c-ecbd-4cfa-b88d-1504b55bebd3/channels?session_id=0E453CCA133540FEB36DE62324C09F20', version='HTTP/1.1', remote_ip='127.0.0.1') Traceback (most recent call last): File "/home/cohen/.local/lib/python3.6/site-packages/tornado/websocket.py", line 546, in _run_callback result = callback(*args, **kwargs) File "/usr/lib/python3/dist-packages/notebook/services/kernels/handlers.py", line 258, in open super(ZMQChannelsHandler, self).open() File "/usr/lib/python3/dist-packages/notebook/base/zmqhandlers.py", line 168, in open self.send_ping, self.ping_interval, io_loop=loop, TypeError: __init__() got an unexpected keyword argument 'io_loop'Thanks in advance!