13

Once I opened a notebook file with Jupyter (it asks me to convert the file) I never can open it in the standard IPython notebook anymore. I get the following error:

Error loading notebook
Bad Request
2014年12月21日 04:13:03.203 [NotebookApp] WARNING | Unreadable Notebook: /FunIT experiment.ipynb global name 'NBFormatError' is not defined
WARNING:tornado.access:400 GET /api/notebooks/FunIT%20experiment.ipynb?_=1419153182928 (::1) 3.11ms referer=http://localhost:8888/notebooks/FunIT%20experiment.ipynb

An example of such corrupted files is this one: https://www.dropbox.com/s/7io99wpoivxmc8f/FunIT%20experiment.ipynb?dl=0

How can I revert this process? I need to open these files with the standard IPython notebook (v2.2.0).

asked Dec 21, 2014 at 9:23
2
  • Which version of IPython are you using? Commented Dec 21, 2014 at 21:07
  • I am using IPython 2.2.0 Commented Dec 21, 2014 at 21:09

3 Answers 3

12

This problem has to do with incompatibility of the notebook and your IPython version. In my current version of IPython:

ipython --version 
2.3.1

When I try to open the file (FunIT\ experiment.ipynb):

ipython notebook FunIT\ experiment.ipynb 

I get the following error message

Error loading notebook

Unreadable Notebook: FunIT experiment.ipynb Unsupported nbformat version 4

The error message indicates that the notebook format is not supported. Let's install the development version, https://github.com/ipython/ipython. I used virtual Environment, http://docs.python-guide.org/en/latest/dev/virtualenvs/, but it's not necessary.

Install virtual environment

pip install virtualenv
mkdir test
cd test
virtualenv venv
source venv/bin/activate

Ipython Notebook development installation

git clone --recursive https://github.com/ipython/ipython.git
cd ipython
pip install -e ".[notebook]" --user

Now I have the current development version.

ipython --version
3.0.0-dev

And I can open the file with ipython notebook

ipython notebook FunIT\ experiment.ipynb

Here is a snippet of the code:

import pandas as pd
import numpy as np
from pandas.tools.pivot import pivot_table
#from sklearn.metrics import roc_auc_score
import matplotlib.pyplot as plt
%pylab inline
#from sklearn.neighbors.kde import KernelDensity
import seaborn as sns
import scipy.stats as st
sns.set()
answered Dec 22, 2014 at 1:39
Sign up to request clarification or add additional context in comments.

Comments

11

Upgrading IPython fixed it for me:

pip install ipython --upgrade

answered Apr 29, 2015 at 15:26

1 Comment

I found an ipython2.7 binary installed so i am running it instead of ipython.
9

This works for me perfectly:

pip install jupyter
answered Nov 18, 2015 at 16:22

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.