Python Jupyter 笔记本不受信任

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/44943646/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 00:39:01  来源:igfitidea点击:

Jupyter notebook not trusted

pythonanacondajupyter-notebook

提问by Clément F

I am using Anaconda to work on a Jupyter notebook which displays "Not Trusted" (see on screenshot below).

我正在使用 Anaconda 处理显示“不可信”的 Jupyter 笔记本(请参见下面的屏幕截图)。

enter image description here

在此处输入图片说明

What does it mean? Is it a problem? How can I solve it?

这是什么意思?这是个问题吗?我该如何解决?

采纳答案by Anis

It is a security feature to disable the execution of arbitrary code from untrusted notebooks, without the user's consent. There is a doc page on that http://jupyter-notebook.readthedocs.io/en/latest/security.html

这是一项安全功能,可在未经用户同意的情况下禁止从不受信任的笔记本执行任意代码。http://jupyter-notebook.readthedocs.io/en/latest/security.html上有一个文档页面

It won't prevent you from manually running the code, that's actually one way of "trusting" the outputs.

它不会阻止您手动运行代码,这实际上是“信任”输出的一种方式。

回答by Vincent Pakson

You can try doing

你可以尝试做

jupyter trust notebook-name.ipynb

as is stated in the docs.

正如文档中所述。

After that, open the notebook as usual with

之后,像往常一样打开笔记本

jupyter notebook notebook-name.ipynb

回答by Baban Gain

Apart from them,
You can click on "Not Trusted"
and click on "Trust" when confirmation window pops up.

除此之外,
您可以单击“不信任”
,然后在弹出确认窗口时单击“信任”。

回答by Bohumir Zamecnik

This can also happen when you create a notebook in a docker container with mounted volume (the file is owned by the root user) and then open in in jupyter running on the host machine. Changing file owner to the host user helps.

当您在具有挂载卷(该文件由 root 用户拥有)的 docker 容器中创建笔记本,然后在主机上运行的 jupyter 中打开时,也会发生这种情况。将文件所有者更改为主机用户会有所帮助。