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

依然范特西╮ 提交于 2019-12-20 17:26:25

问题


I've just installed IPython 3.0 using pip on my laptop, which is running 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)

However, when I go to use IPython, the terminal seems to think it's using version 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]

What's worse is, when I go to open a notebook in JSON nbformat version 4, which IPython 3.0 supports, I get the following error:

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

I've attempted to downgrade the notebook to version 3, using the command recommended by the IPython team, but that fails for me as well:

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

What's going on here?


回答1:


An older version of IPython was installed previously using apt-get. Remove the older version using apt-get remove ipython.




回答2:


jupyter nbconvert --to notebook --nbformat=3 <file.ipynb> worked for me. My local anaconda2 support version 4 but docker's ipython cannot.



来源:https://stackoverflow.com/questions/29286152/unreadable-notebook-unsupported-json-nbformat-version-4-supported-version-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!