Is IPython notebook 1.1.0 backwards incompatible with 1.0? I get "unreadable notebook" error

StackOverflow https://stackoverflow.com/questions/21399312

  •  03-10-2022
  •  | 
  •  

Question

I installed IPython 1.1.0 on Ubuntu 12.04 using pip install. I can open IPython notebooks downloaded e.g. from here, or create my own. All run properly without any error messages.

However, when trying to work on the notebooks I downloaded here, I get an error message

 Unreadable Notebook: Notebook does not appear to be JSON: '{\n "metadata": {'

Looking at the contents on an editor, the notebooks which open properly have this structure:

{
 "metadata": {
     "name": "Basics"
 }, 
 "nbformat": 2, 
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "code", 
     "collapsed": false, 
     "input": [
      "import numpy as np" 
     ], 
     "language": "python", 
     "outputs": [], 
     "prompt_number": 3
    }
   ]
  }
 ]
}

while the ones which give me the error message look like this (simplified, but true to the rules of the original):

{
 "metadata": {
  "name": "Basics"
 }, 
 "nbformat": 2, 
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "code", 
     "language": "python", 
     "outputs": [], 
     "collapsed": False, 
     "prompt_number": 10, 
     "input": [
      "import numpy as np"
     ], 
     "metadata": {}
    }
   ]
  }
 ]
}

Is this some version compatibility issue? The most obvious difference is that there is a "metadata" field in the notebook which does not run. Is there some way to run these notebooks which are not recognized as JSON (besides removing all the "metadata": {} entries)?

Was it helpful?

Solution

metadata field is optional and won't change a thing. The error you see is (often) due to a stale cache in javascript files (force refresh). I can open the linked notebook on IPython master, and did resaved it immediately here if you would like to try.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top