【问题标题】:Jupyter Kernel dies from nbconvert but not on jupyterJupyter 内核死于 nbconvert 但不是在 jupyter
【发布时间】:2019-01-06 09:38:12
【问题描述】:

我创建了一个简单的内核,它封装了一个单元格的内容,并在 jupyter 上的特定数据库中将其作为 SQL 执行。

当我在安装了它的 jupyter notebook 上打开它并正常执行时,内核完全按预期工作。

但是当我尝试使用 nbconvert 执行笔记本时,它会在回复之前抛出以下关于内核已死的错误。

Exception in thread Thread-31:
Traceback (most recent call last):
  File "/opt/anaconda/4.2.0/envs/py36/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/opt/anaconda/4.2.0/envs/py36/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "<ipython-input-5-d1a08220a4cf>", line 87, in threadedOperation
    ep.preprocess(nb, {'metadata': {'path': ''}})
  File "/opt/anaconda/4.2.0/envs/py36/lib/python3.6/site-packages/nbconvert/preprocessors/execute.py", line 257, in preprocess
    cwd=path)
  File "/opt/anaconda/4.2.0/envs/py36/lib/python3.6/site-packages/nbconvert/preprocessors/execute.py", line 241, in start_new_kernel
    kc.wait_for_ready(timeout=startup_timeout)
  File "/opt/anaconda/4.2.0/envs/py36/lib/python3.6/site-packages/jupyter_client/blocking/client.py", line 120, in wait_for_ready
    raise RuntimeError('Kernel died before replying to kernel_info')
RuntimeError: Kernel died before replying to kernel_info

关于可能导致此问题的原因或我可以从哪里开始寻找答案的任何想法?

【问题讨论】:

  • 每个人都找到了解决方案?遇到类似的问题:)
  • 确实没有找到解决方案,但我最终完全重写了内核的逻辑,并且作为副作用它以某种方式解决了这个问题。仍然不知道是什么原因造成的。我相信某些版本的 jupyter 和 nbconvert 也存在一些问题,因此更新到最新版本也可能是一个潜在的修复方法。
  • 在 2020 年使用 Google Colab 发现了同样的问题。有人找到解决方案了吗?

标签: python jupyter-notebook


【解决方案1】:

找到解决办法

python3 -m ipykernel install --user

https://github.com/udacity/aind2-dl/issues/9

【讨论】:

    猜你喜欢
    • 2016-05-14
    • 1970-01-01
    • 2022-01-24
    • 1970-01-01
    • 1970-01-01
    • 2021-11-03
    • 1970-01-01
    • 2016-01-03
    相关资源
    最近更新 更多