IPython Notebook error: Error loading notebook

扶醉桌前 提交于 2020-02-01 03:20:06

问题


Within the past few minutes, I have not been able to access any of the .ipynb files previously created with Python3.4. I go to the subdirectory with these files, enter

ipython3 notebook

When I open a "New" notebook, I get the following error:

Unexpected error while saving file: Untitled1.ipynb database disk image is malformed

I cannot open old notebooks either. I get the error:

An unknown error occurred while loading this notebook. This version can load notebook formats v4 or earlier. See the server log for details.

and within the Terminal, it states

kernels (twice to skip confirmation).
[E 00:30:22.352 NotebookApp] Unhandled error in API request
    Traceback (most recent call last):
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/traitlets/traitlets.py", line 460, in get
        value = obj._trait_values[self.name]
    KeyError: 'db'

How can I fix this?


回答1:


Search for nbsignatures.db. It should be either here:

~/.ipython/profile_default/security/nbsignatures.db

or here:

 ~/Library/Jupyter/nbsignatures.db

The ~ stands for you home directory.

Move this file this to a temporary directory.

Restart your IPython Notebook server.




回答2:


Since I couldn't find any of the files mentioned in the other answers, I looked for another solution and found this one to work for me:

I solved this problem by changing the ownership of the ~/.local/share/jupyter directory from root to user.

from https://github.com/ipython/ipython/issues/8997




回答3:


This won't be the issue for everyone, but I got the below error message because the disk was actually full.

An unknown error occurred while loading this notebook. This version can load notebook formats v4 or earlier. See the server log for details.



回答4:


remove ~/.ipython/profile_default/history.sqlite

this helps for me.



来源:https://stackoverflow.com/questions/34960020/ipython-notebook-error-error-loading-notebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!