8

I have recently started working with the ipython notebook. Have created several test scripts for the same. On opening one of the files (.ipynb) it gives me an error: " Unreadable Notebook: /home/dev/Feedbacks_exploration.ipynb NotJSONError("Notebook does not appear to be JSON: u''...",) "

This file included fetching data from psql, plotting of a line graph, and a block of markdown.

Can anyone please help guide me hoe to open this file? It has some of the important functions that could be used.

Thanks!!!

eclairs
  • 1,515
  • 6
  • 21
  • 26
  • 1
    Copy the contents of the notebook, paste them into http://jsonlint.com/, and see what is wrong with the JSON. – Alex Hall Sep 22 '15 at 08:22
  • The issue is, i cant open the notebook. Also, if i try to open it using text editor, all i get is a blank file. How should i go about it? – eclairs Sep 23 '15 at 10:19
  • Sorry, should have clarified when I said copy the contents that I meant using a plain text editor. If it shows a blank file then maybe it's a blank file and the data was lost somehow. What happens if you `ls -l`, `wc`, or `head` the file? – Alex Hall Sep 23 '15 at 10:33
  • Do you have any evidence that it's not a blank file? What size is it? Do you know how to use a terminal and if so what happens when you run any of the above commands? – Alex Hall Sep 24 '15 at 22:37
  • If i paste it on the text editor, it gives me a blank file only. I guess the has gone blank. – eclairs Sep 28 '15 at 11:43

4 Answers4

7

The problem for me was that I had an unresolved merge conflict in my ipython notebook. So I opened the file and deleted one version (HEAD>>>>> and what came after it up until ======= and then the line containing <<<<<<). In short, resolve the merge conflict and you'll be good.

crytting
  • 181
  • 1
  • 9
  • My ipynb is too long and contains images. I cannot edit it by hand, it makes the editor go laggy. Is there an automated tool that would resolve the conflict automatically and give me one or both versions ? – 021 Jun 18 '19 at 15:04
4

I've faced similar problem when I'm using IPython notebook (Jupyter) for H2O. I installed Anaconda Ver 3.X and when i did with Anaconda 2.7.9 it worked without the JSON error. It's because IPython (Jupyter) doesn't yet support for Version 3.X of Anaconda (Python)

Mounika Kakarla
  • 124
  • 1
  • 3
0

I got this error once when I tried to use nbformat to read in several notebooks that I was currently running (including the one from which I ran the nbformat commands). The error went away the next time I tried loading the notebooks (I might have saved in between) and hasn't occurred again since.

Nathan
  • 9,651
  • 4
  • 45
  • 65
0

I had a similar issue and neen able to solve it in the following way.

It is a bit of quirky solution but it works.

Raf
  • 323
  • 2
  • 7