2014-12-21 17 views
11

Una volta che ho aperto un file del notebook con Jupyter (mi chiede di convertire il file) non posso più aprirlo nel notebook standard IPython. Ottengo il seguente errore:Errore durante il caricamento del notebook IPython

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 

Un esempio di tali file danneggiati è questa: https://www.dropbox.com/s/7io99wpoivxmc8f/FunIT%20experiment.ipynb?dl=0

Come posso ripristinare questo processo? Ho bisogno di aprire questi file con il notebook IPython standard (v2.2.0).

+0

Quale versione di IPython stai usando? – xnx

+0

Sto usando IPython 2.2.0 – amaatouq

risposta

11

Questo problema ha a che fare con l'incompatibilità del notebook e della versione di IPython. Nella mia versione corrente di IPython:

ipython --version 
2.3.1 

Quando provo ad aprire il file (FunIT \ experiment.ipynb):

ipython notebook FunIT\ experiment.ipynb 

ottengo il seguente messaggio di errore

Error loading notebook

Unreadable Notebook: FunIT experiment.ipynb Unsupported nbformat version 4

Il messaggio di errore indica che il formato del notebook non è supportato. Installiamo la versione di sviluppo, https://github.com/ipython/ipython. Ho usato l'ambiente virtuale, http://docs.python-guide.org/en/latest/dev/virtualenvs/, ma non è necessario.

Installare ambiente virtuale

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

installazione ipython sviluppo Notebook

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

Ora ho la versione di sviluppo corrente.

ipython --version 
3.0.0-dev 

E posso aprire il file con ipython notebook

ipython notebook FunIT\ experiment.ipynb 

Ecco un frammento di codice:

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() 
+0

Grazie. Questo ha risolto il problema. – amaatouq

+0

la mia versione è 4.1 ma mostra ancora lo stesso errore – Frazer

10

Aggiornamento di IPython fissata per me:

pip install ipython --upgrade

+0

Ho trovato un binario ipython2.7 installato, quindi lo sto eseguendo invece di ipython. –

8

Questo funziona perfettamente per me:

pip install jupyter 
Problemi correlati