Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error loading IPython notebook

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).

like image 560
amaatouq Avatar asked Dec 21 '14 09:12

amaatouq


People also ask

Why is my Jupyter Notebook not launching?

Jupyter fails to start If you're using a menu shortcut or Anaconda launcher to start it, try opening a terminal or command prompt and running the command jupyter notebook . If it can't find jupyter , you may need to configure your PATH environment variable.

How do I reset my IPython notebook?

You can restart your Jupyter Kernel by simply clicking Kernel > Restart from the Jupyter menu. Note: This will reset your notebook and remove all variables or methods you've defined! Sometimes you'll notice that your notebook is still hanging after you've restart the kernel. If this occurs try refreshing your browser.

What is the iPython notebook?

(Formerly known as the IPython Notebook)¶. The IPython Notebook is now known as the Jupyter Notebook. It is an interactive computational environment, in which you can combine code execution, rich text, mathematics, plots and rich media. For more details on the Jupyter Notebook, please see the Jupyter website.

Why can’t I open my files with the standard iPython notebook?

I need to open these files with the standard IPython notebook (v2.2.0). Show activity on this post. This problem has to do with incompatibility of the notebook and your IPython version. In my current version of IPython: The error message indicates that the notebook format is not supported.

Why is IPython not working in Python?

Solution: It means, the program is trying to reference ipython library that’s not installed in the system. All you need is, install ipython using pip as shown below:

What is Jupyter Notebook in Python?

(Formerly known as the IPython Notebook)¶. The IPython Notebook is now known as the Jupyter Notebook. It is an interactive computational environment, in which you can combine code execution, rich text, mathematics, plots and rich media.


2 Answers

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()
like image 182
maiaini Avatar answered Sep 23 '22 15:09

maiaini


Upgrading IPython fixed it for me:

pip install ipython --upgrade

like image 43
leekaiinthesky Avatar answered Sep 21 '22 15:09

leekaiinthesky