【问题标题】:Why does jupyter display "None not found"?为什么 jupyter 显示“未找到”?
【发布时间】:2016-11-25 20:27:12
【问题描述】:

我正在尝试使用 jupyter 编写和编辑 python 代码。我打开了一个 .ipynb 文件,但我在右上角看到“未找到”,并且我无法执行我编写的任何代码。奇怪的是,我打开其他 .ipynb 文件并没有问题。此外,当我单击红色的“None not found”图标时,我会收到消息“‘None’内核不可用。请选择另一个合适的内核,或安装该内核。”我安装了 Python 3.5.2。我怀疑问题是 jupyter 没有检测到 Python 3 内核?它在应该显示“Python 3”的地方显示“Python [root]”。有谁知道如何解决这个问题?

Screenshot of working code

Screenshot "None not found"

【问题讨论】:

  • 这种情况经常发生,例如当您将 ipynb 文件从 Jupyter 版本 3 更新到 4 时。您只需选择 Root 内核并保存文件。然后再次打开它,你应该有新的内核。

标签: python kernel anaconda jupyter jupyter-notebook


【解决方案1】:

我怀疑特定的 .ipynb 文件包含一些元数据,指定了您尚未安装的内核 - 请参阅 the file format specification

如果您使用文本编辑器打开该文件并搜索 metadata,您应该会看到如下内容:

{
  "metadata" : {
    "signature": "hex-digest", # used for authenticating unsafe outputs on load
    "kernel_info": {
        # if kernel_info is defined, its name field is required.
        "name" : "the name of the kernel"
    },
    "language_info": {
        # if language_info is defined, its name field is required.
        "name" : "the programming language of the kernel",
        "version": "the version of the language",
        "codemirror_mode": "The name of the codemirror mode to use [optional]"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0,
  "cells" : [
      # list of cell dictionaries, see below
  ],
}

一种选择是将内核和语言条目更改为空字典,但您可能会发现此笔记本实际上是 iR 笔记本,或其他几个笔记本中的任何一个。

【讨论】:

    【解决方案2】:

    在新安装之前工作的笔记本上新安装 Anaconda 后出现同样的问题。我安装了旧版本(3 4.0.0),问题已解决。

    【讨论】:

      【解决方案3】:

      我在这里遇到了同样的问题。我的解决方案是:

      1. 在内核菜单中 -> 更改内核 -> 选择 Python [Root](或 你想要的内核),
      2. 保存文件,
      3. 关闭它,
      4. 重新打开它。

      【讨论】:

        【解决方案4】:

        更改内核 Python[Root] 保存、关闭并重新打开

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2020-03-06
          • 1970-01-01
          • 2022-06-16
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2014-09-12
          相关资源
          最近更新 更多