Python继续运行pyter无法重新连接的代码

2024-06-17 14:52:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我搜索过其他帖子,似乎找不到一个能满足我对jupyter笔记本问题的答案。笔记本电脑启动良好,但不断重新连接内核,不会执行任何代码块。我只在左边的括号里有一个星,它甚至不会执行一个简单的print语句。以下是jupyter笔记本客户端的输出:

[W 22:08:13.025 NotebookApp] Terminals not available (error was No module 
named 'winpty.cywinpty')
[I 22:08:13.027 NotebookApp] Serving notebooks from local directory: 
C:\Users\rsq2_\Downloads\RSQTest\venv\Scripts
[I 22:08:13.028 NotebookApp] The Jupyter Notebook is running at:
[I 22:08:13.028 NotebookApp] http://localhost:9999/? 
token=9777b5132d5ad6e00ddb64f3f6d4f8ca3a705f90ad515d7b
[I 22:08:13.028 NotebookApp] Use Control-C to stop this server and shut down 
all kernels (twice to skip confirmation).
[C 22:08:13.071 NotebookApp]

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
    http://localhost:9999/? 
token=9777b5132d5ad6e00ddb64f3f6d4f8ca3a705f90ad515d7b
[I 22:08:13.189 NotebookApp] Accepting one-time-token-authenticated 
connection from ::1
[I 22:08:17.765 NotebookApp] Creating new notebook in
[I 22:08:19.113 NotebookApp] Kernel started: 610a6f8c-bf7f-45bc-9025- 
70896e912238
[I 22:08:20.386 NotebookApp] Adapting to protocol v5.1 for kernel 610a6f8c- 
bf7f-45bc-9025-70896e912238
[I 22:08:20.400 NotebookApp] Starting buffering for 610a6f8c-bf7f-45bc-9025- 
70896e912238:69e5000561cf4ee6b54b9cc8e508446f
[I 22:08:21.420 NotebookApp] Adapting to protocol v5.1 for kernel 610a6f8c- 
bf7f-45bc-9025-70896e912238
[I 22:08:21.423 NotebookApp] Restoring connection for 610a6f8c-bf7f-45bc- 
9025-70896e912238:69e5000561cf4ee6b54b9cc8e508446f
[I 22:08:21.434 NotebookApp] Starting buffering for 610a6f8c-bf7f-45bc-9025- 
70896e912238:69e5000561cf4ee6b54b9cc8e508446f
[I 22:08:22.472 NotebookApp] Adapting to protocol v5.1 for kernel 610a6f8c- 
bf7f-45bc-9025-70896e912238
[I 22:08:22.476 NotebookApp] Restoring connection for 610a6f8c-bf7f-45bc- 
9025-70896e912238:69e5000561cf4ee6b54b9cc8e508446f
[I 22:08:24.316 NotebookApp] Starting buffering for 610a6f8c-bf7f-45bc-9025- 
70896e912238:69e5000561cf4ee6b54b9cc8e508446f
[I 22:08:25.382 NotebookApp] Adapting to protocol v5.1 for kernel 610a6f8c- 
bf7f-45bc-9025-70896e912238
[I 22:08:25.386 NotebookApp] Restoring connection for 610a6f8c-bf7f-45bc- 
9025-70896e912238:69e5000561cf4ee6b54b9cc8e508446f
[I 22:08:25.389 NotebookApp] Starting buffering for 610a6f8c-bf7f-45bc-9025- 
70896e912238:69e5000561cf4ee6b54b9cc8e508446f
[I 22:08:26.424 NotebookApp] Adapting to protocol v5.1 for kernel 610a6f8c- 
bf7f-45bc-9025-70896e912238
[I 22:08:26.428 NotebookApp] Restoring connection for 610a6f8c-bf7f-45bc- 
9025-70896e912238:69e5000561cf4ee6b54b9cc8e508446f

我看到上面写着“终端不可用”,但不确定如何解决这个问题。我目前正在学习Python视频课程,并建议使用jupyter笔记本。所以我不知道如何解决这个问题。谢谢你的帮助!我正在运行Win10 64位。在

编辑:根本不要求密码,是的,我第一次使用令牌登录。一切启动良好,并创建新的Python3笔记本文件。但一旦进入笔记本,它就不会运行任何代码行。我按了shift+enter来执行单元格,它只带我到下一个空白单元格,而不执行任何操作。在

enter image description here

enter image description here

enter image description here


Tags: to代码tokenfor笔记本jupyterconnectionkernel
3条回答

试着降低你的龙卷风版本。当conda将Tornado升级到6.0时,我也遇到了类似的问题:单元无法执行。在

$ conda install tornado=5.1.1

conda回购中还没有Tornado 5.7.5。在

如果jupyter设置在反向代理(nginx)之后,请参阅这里的答案。 这对我有用:jupyter notebook keeps reconnecting

我也有类似的问题。进入Anaconda>;环境并在那里更新ipython和ipkernel模块似乎解决了这个问题。在

相关问题 更多 >