Search code examples
jupyter-notebookanacondaanaconda3

downgrading nbformat to prevent "Notebook JSON is invalid" errors


I'm trying to run nbconvert on a large bunch of Jupyter notebooks. These are assignment submissions from my students. The problem is that I get the following message

[NbConvertApp] ERROR | Notebook JSON is invalid: {'model_id': '5d85f9c5bb174b0f86e823471671928a', 'version_major': 2, 'version_minor': 0} is not valid under any of the given schemas

When I run conda list nbformat I get

# packages in environment at /home/taylor/anaconda3:
#
# Name                    Version                   Build  Channel
nbformat                  5.0.4                      py_0  

I read somewhere that the error goes away if you open up the notebook in Jupyter notebook,and run every cell. However, I don't have time to do that. Should I just downgrade to version, say, 4.4.0?


Solution

  • Downgrading worked:

    conda install nbformat=4.4.0

    This is the version that all my students have.