【问题标题】:Unreadable Notebook: Unsupported JSON nbformat version 4 (supported version: 3)不可读的笔记本:不支持 JSON nbformat 版本 4(支持的版本:3)
【发布时间】:2015-03-26 18:28:00
【问题描述】:

我刚刚在运行Ubuntu 14.04 的笔记本电脑上使用pip 安装了IPython 3.0:

$ pip search ipython
ipython-cluster-helper    - Simplify IPython cluster start up and use for
                            multiple schedulers.
ipython                   - IPython: Productive Interactive Computing
  INSTALLED: 3.0.0 (latest)

但是,当我去使用IPython时,终端似乎认为它使用的是1.2.1版本:

$ ipython
Python 2.7.6 (default, Mar 22 2014, 22:59:38) 
Type "copyright", "credits" or "license" for more information.

IPython 1.2.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]

更糟糕的是,当我打开 IPython 3.0 支持的 JSON nbformat 版本 4 的笔记本时,我收到以下错误:

Unreadable Notebook: Unsupported JSON nbformat version 4 (supported version: 3)

我尝试使用IPython 团队推荐的命令将笔记本降级到版本 3,但我也失败了:

$ ipython nbconvert --to notebook --nbformat 3 1-intro-to-brian-neurons.ipynb 
. . .
[NbConvertApp] CRITICAL | Bad config encountered during initialization:
[NbConvertApp] CRITICAL | Unrecognized flag: '--nbformat'

这是怎么回事?

【问题讨论】:

  • 我应该提一下我已经从我的笔记本电脑上卸载了除当前版本之外的所有版本的IPython
  • 你是否从 apt 安装了 ipython?这可能是旧版本,这就是您所看到的。 nbconvert 的 --nbformat 标志是 IPython 3 中的新标志,因此我也希望旧版本会出现该错误。
  • Naa,我使用pip 安装,如问题所述。我之前可能使用apt-get 安装过它,但我在使用pip 重新安装之前卸载了IPython
  • 等等,啊,我想你可能是对的。我刚刚运行了apt-get remove ipython——我以前没有这样做过——我只运行pip uninstall ipython——然后找到并删除了IPython 1.2。
  • 是的,问题解决了!

标签: json ubuntu ipython ubuntu-14.04 ipython-notebook


【解决方案1】:

之前使用apt-get 安装了旧版本的IPython。使用 apt-get remove ipython 删除旧版本。

【讨论】:

    【解决方案2】:

    jupyter nbconvert --to notebook --nbformat=3 <file.ipynb> 为我工作。 我本地的 anaconda2 支持版本 4,但 docker 的 ipython 不支持。

    【讨论】:

      猜你喜欢
      • 2021-04-12
      • 2018-02-15
      • 2013-11-10
      • 2012-08-22
      • 1970-01-01
      • 2018-09-11
      • 2021-05-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多