8

运行 jupyter notebook 时出现此错误。任何想法?

An invalid notebook may not function properly. The validation error was:
Notebook validation failed: ['outputPrepend', 'outputPrepend', 'outputPrepend', 'outputPrepend', 'outputPrepend'] has non-unique elements:
[
 "outputPrepend",
 "outputPrepend",
 "outputPrepend",
 "outputPrepend",
 "outputPrepend"
]
4

1 回答 1

10

我遇到过同样的问题。我已经使用 Jupiter 日志解决了这个问题。我的木星日志是

(venv) > jupyter notebook     
[I 18:12:33.188 NotebookApp] Serving notebooks from local directory: /home/engmrgh/Projects/
[I 18:12:33.188 NotebookApp] The Jupyter Notebook is running at:
[I 18:12:33.188 NotebookApp] http://localhost:8888/?token=3a9a191653274c25f7cf09049d87b8588fefbda0ec48fcd4
[I 18:12:33.189 NotebookApp]  or http://127.0.0.1:8888/?token=3a9a191653274c25f7cf09049d87b8588fefbda0ec48fcd4
[I 18:12:33.189 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 18:12:33.255 NotebookApp] 
    
    To access the notebook, open this file in a browser:
        file:///home/engmrgh/.local/share/jupyter/runtime/nbserver-6233-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=3a9a191653274c25f7cf09049d87b8588fefbda0ec48fcd4
     or http://127.0.0.1:8888/?token=3a9a191653274c25f7cf09049d87b8588fefbda0ec48fcd4
[E 18:12:42.647 NotebookApp] Notebook JSON is invalid: ['outputPrepend', 'outputPrepend'] has non-unique elements
    
    Failed validating 'uniqueItems' in code_cell['properties']['metadata']['properties']['tags']:
    
    On instance['cells'][38]['metadata']['tags']:
    ['outputPrepend', 'outputPrepend']
[W 18:12:42.707 NotebookApp] Notebook LDA.ipynb is not trusted
[I 18:12:44.126 NotebookApp] Kernel started: 28c189d6-a445-417a-9577-88fadd4464ea
[I 18:24:35.296 NotebookApp] Saving file at /LDA.ipynb
[W 18:24:35.296 NotebookApp] Notebook LDA.ipynb is not trusted

上述日志的重要部分是:

On instance['cells'][38]['metadata']['tags']: ['outputPrepend', 'outputPrepend']

基本上它说笔记本的单元格 39(索引从 0 开始,所以 38+1)有问题。当我启用元数据并转到单元格 39 时,通过单击metadata单元格中出现的按钮,我看到元数据的内容是为验证显示的错误,删除内容解决了问题。

注意: 要启用每个单元格的元数据,请按照View > Cell Toolbar > Edit Metadata下图所示进行操作。

在此处输入图像描述

于 2020-04-27T14:15:30.290 回答