IPython笔记本错误:加载noteb时出错

2024-05-12 19:21:51 发布

您现在位置:Python中文网/ 问答频道 /正文

在过去的几分钟内,我无法访问以前用Python3.4创建的任何.ipynb文件。我把这些文件转到子目录,输入

ipython3 notebook

当我打开一个“新”笔记本时,会出现以下错误:

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

我也不能打开旧笔记本。我知道错误:

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

在终端里,它显示

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'

我该怎么解决?


Tags: 文件in错误笔记本errordatabasefileipynb
3条回答

因为我找不到其他答案中提到的任何文件,所以我寻找了另一个解决方案,找到了一个适合我的解决方案:

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

来自https://github.com/ipython/ipython/issues/8997

删除~/.ipython/profile\u default/history.sqlite

这对我有帮助。

搜索nbsignatures.db。它应该在这里:

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

或者这里:

 ~/Library/Jupyter/nbsignatures.db

~代表您的主目录。

将此文件移到临时目录。

重新启动IPython笔记本服务器。

相关问题 更多 >