Error loading IPython notebook

后端 未结 3 1713
梦毁少年i
梦毁少年i 2021-02-07 22:17

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:



        
3条回答
  •  伪装坚强ぢ
    2021-02-07 23:09

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

提交回复
热议问题