Ipython/Jupyter:等待 kernel_info 回复超时

Posted

技术标签:

【中文标题】Ipython/Jupyter:等待 kernel_info 回复超时【英文标题】:Ipython/Jupyter: Timeout waiting for kernel_info reply 【发布时间】:2016-07-25 17:30:53 【问题描述】:

我通过 ipython 和 anaconda 使用 python 2.7。我重新启动了计算机,尝试了不同的笔记本并尝试通过 conda 命令行更新内容。然而,每次我尝试打开笔记本时,内核都会超时,这似乎会使笔记本崩溃。有谁知道如何解决这个问题?

更新:从笔记本中重新启动内核后,终端给出了以下消息:

[E 17:45:18.308 NotebookApp] Exception restarting kernel
    Traceback (most recent call last):
      File "C:\Users\bidby\Anaconda\lib\site- packages\notebook\services\kernels\handlers.py", line 88, in post
    yield gen.maybe_future(km.restart_kernel(kernel_id))
  File "C:\Users\bidby\Anaconda\lib\site-packages\tornado\gen.py", line 870, in run
    value = future.result()
  File "C:\Users\bidby\Anaconda\lib\site-packages\tornado\concurrent.py", line
 215, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 3, in raise_exc_info
TimeoutError: Timeout waiting for restart
[E 17:45:18.308 NotebookApp] 
  "Origin": "http://localhost:8888",
  "Content-Length": "0",
  "Accept-Language": "en-US,en;q=0.8",
  "Accept-Encoding": "gzip, deflate",
  "Host": "localhost:8888",
  "Accept": "application/json, text/javascript, */*; q=0.01",
  "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHT
ML, like Gecko) Chrome/49.0.2623.110 Safari/537.36",
  "Connection": "keep-alive",
  "X-Requested-With": "XMLHttpRequest",
  "Referer": "http://localhost:8888/notebooks/Desktop/The%20Prodge/For%20bidby
/SVC-CycleAverages-New-Copy2.ipynb"

[E 17:45:18.308 NotebookApp] 500 POST /api/kernels/8df55a56-0cb9-431c-8034-db6c1
6fee7ba/restart (::1) 31152.00ms referer=http://localhost:8888/notebooks/Desktop
/The%20Prodge/For%20bidby/SVC-CycleAverages-New-Copy2.ipynb
[I 17:45:19.460 NotebookApp] Kernel shutdown: 8df55a56-0cb9-431c-8034-db6c16fee7ba

笔记本也给出了这个:

内核死机,自动重启失败。内核可能无法重新启动。如果您无法重新启动内核,您仍然可以保存 notebook,但在重新打开 notebook 之前,正在运行的代码将不再工作。

当我关闭并重新打开笔记本时,终端会这样说:

[I 17:46:17.394 NotebookApp] Saving file at /Desktop/The Prodge/For bidby/SVC-CycleAverages-New-Copy2.ipynb
[W 17:46:17.398 NotebookApp] Saving untrusted notebook Desktop/The Prodge/For bidby/SVC-CycleAverages-New-Copy2.ipynb
[W 18:01:59.888 NotebookApp] Session not found: session_id=u'1768b420-e3ba-4f69-a392-d476b76a5774'
[W 18:01:59.905 NotebookApp] 404 DELETE /api/sessions/1768b420-e3ba-4f69-a392-d476b76a5774 (::1) 17.00ms referer=http://localhost:8888/notebooks/Desktop/The%20Prodge/For%20bidby/SVC-CycleAverages-New-Copy2.ipynb
[I 18:02:00.019 NotebookApp] Kernel started: a7d04bdf-d0c8-4b53-be62-3344c6b0f453
[W 18:02:10.052 NotebookApp] Timeout waiting for kernel_info reply from a7d04bdf-d0c8-4b53-be62-3344c6b0f453
[W 18:03:28.661 NotebookApp] Notebook Desktop/The Prodge/For bidby/SVC-CycleAverages-New-Copy2.ipynb is not trusted
[W 18:03:28.815 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20160405174149 (::1) 12.00ms referer=http://localhost:8888/notebooks/Desktop/The%20Prodge/For%20bidby/SVC-CycleAverages-New-Copy2.ipynb
[I 18:05:34.392 NotebookApp] Saving file at /Desktop/The Prodge/For bidby/SVC-CycleAverages-New-Copy2.ipynb
[W 18:05:34.395 NotebookApp] Saving untrusted notebook Desktop/The Prodge/For bidby/SVC-CycleAverages-New-Copy2.ipynb

【问题讨论】:

您启动笔记本的终端是否有任何错误消息? 更新了问题 【参考方案1】:

我遇到了同样的问题,通过停用防病毒 (AVG) 解决了这个问题。这可能是一个安全问题...

为了重现该问题,我重新安装了 Anaconda2-4.0.0-Windows-x86_64 并在激活 AVG 时遇到了同样的错误。

亲切的问候 阿德里安

【讨论】:

以上是关于Ipython/Jupyter:等待 kernel_info 回复超时的主要内容,如果未能解决你的问题,请参考以下文章

更改 IPython/Jupyter 笔记本工作目录

iPython/ Jupyter notebook 只清除一行输出

在 IPython/Jupyter Notebooks 中显示行号

在 IPython (Jupyter) 中更改 Latex 输出的颜色

IPython Jupyter 中的 Julia 并行计算

更改级别记录到 IPython/Jupyter 笔记本