Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to connect to Jupyter Notebook - tornado.websocket.WebSocketClosedError

I have installed Anaconda and when I run Jupyter Notebook and try to create a new notebook, it does not connect. It just tries to connect for a while and I get the Traceback error below.

I have browsed through all the posts regarding this error for two days now without any success. I have tried downgrading tornado to 5.1.1, upgrading notebook, running it in virtual environment etc.

Any help will be greatly appreciated.

[I 20:20:54.106 NotebookApp] Restoring connection for a92303c8-0087-407e-ae8b-e234f4cf7157:f641986b51bf43359e17929728ccbb13
[I 20:20:54.120 NotebookApp] Starting buffering for a92303c8-0087-407e-ae8b-e234f4cf7157:f641986b51bf43359e17929728ccbb13
[I 20:20:55.145 NotebookApp] Restoring connection for a92303c8-0087-407e-ae8b-e234f4cf7157:f641986b51bf43359e17929728ccbb13
[I 20:20:55.156 NotebookApp] Starting buffering for a92303c8-0087-407e-ae8b-e234f4cf7157:f641986b51bf43359e17929728ccbb13
Future exception was never retrieved
future: <Future finished exception=WebSocketClosedError()>
Traceback (most recent call last):
  File "C:\Anaconda\Anaconda3\lib\site-packages\tornado\websocket.py", line 874, in wrapper
    yield fut
  File "C:\Anaconda\Anaconda3\lib\site-packages\tornado\gen.py", line 1133, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Anaconda\Anaconda3\lib\site-packages\tornado\gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "C:\Anaconda\Anaconda3\lib\site-packages\tornado\websocket.py", line 876, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
like image 417
user3052646 Avatar asked Nov 06 '22 09:11

user3052646


1 Answers

This issue occurs when you install tensorfowjs, as you install tensorflowjs, it downgrades prompt-toolkit to version 1.0.14. To solve this you just have to upgrade promp-toolkit to the version 3.0.5 by running the following code in your command prompt:

 pip install prompt-toolkit==3.0.5
like image 136
Chinmay Avatar answered Nov 14 '22 21:11

Chinmay