难以理解的笔记本:不支持的JSON nbformat版本4(支持的版本:3)

时间:2015-03-26 18:28:00

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

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

$ 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'

这里发生了什么?

2 个答案:

答案 0 :(得分:2)

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

答案 1 :(得分:0)

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