简体   繁体   English

无法连接到 Jupyter Notebook - tornado.websocket.WebSocketClosedError

[英]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.我已经安装了 Anaconda,当我运行 Jupyter Notebook 并尝试创建一个新笔记本时,它无法连接。 It just tries to connect for a while and I get the Traceback error below.它只是尝试连接一段时间,我收到下面的 Traceback 错误。

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.我曾尝试将 tornado 降级到 5.1.1、升级笔记本、在虚拟环境中运行它等。

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

This issue occurs when you install tensorfowjs, as you install tensorflowjs, it downgrades prompt-toolkit to version 1.0.14.安装 tensorfowjs 时会出现此问题,在安装 tensorflowjs 时,它会将 prompt-toolkit 降级到 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:要解决此问题,您只需在命令提示符中运行以下代码,将 promp-toolkit 升级到 3.0.5 版:

 pip install prompt-toolkit==3.0.5

Which version of Tornado are you using?您使用的是哪个版本的 Tornado? This should have been fixed in the recently-released 6.0.4这应该已在最近发布的6.0.4 中修复

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM