简体   繁体   English

所有 markdown 单元都是不受信任的

[英]All markdown cells are untrusted

When I create a new notebook in Jupyter Lab, add a line of code, shift-enter, the code runs, produces output and a new cell appears below the first line of code.当我在 Jupyter Lab 中创建一个新笔记本时,添加一行代码,shift-enter,代码运行,生成 output 并且在第一行代码下方出现一个新单元格。 The trust shield icon then changes from a check mark to an 'x'.信任盾图标然后从复选标记变为“x”。 If I delete the blank cell, the trust icon returns to check mark.如果我删除空白单元格,信任图标将返回复选标记。

So far so good, blank cells are untrusted, even after saving.到目前为止一切顺利,空白单元格不受信任,即使在保存之后也是如此。

But if instead of deleting the blank cell, I change it to markdown and enter text and save the notebook (say as testTrust.ipynb), the trust icon remains 'x'.但是,如果我不删除空白单元格,而是将其更改为 markdown 并输入文本并保存笔记本(例如 testTrust.ipynb),则信任图标仍为“x”。 Hovering over the shield icon gives the text: Notebook not trusted, 1 of 2 cells trusted.将鼠标悬停在盾牌图标上会显示文本:笔记本不受信任,2 个单元中的 1 个受信任。 In a longer notebook, every markdown cell is counted as untrusted.在更长的笔记本中,每个 markdown 单元都被计为不受信任。

Running跑步

jupyter trust testTrust.ipynb

gives

ERROR | Notebook missing: testTrust.ipynb

This is a new install in a new virtual environment, installed through miniconda:这是新虚拟环境中的新安装,通过 miniconda 安装:

    conda install -c conda-forge jupyterlab nodejs ipympl

where inclusion of the nodejs package was triggered by a previous install attempt giving:其中包含 nodejs package 是由先前的安装尝试触发的:

Could not determine jupyterlab build status without nodejs

at launch, and ipympl was included for use of %matplotlib widgets magic.在启动时,包含了 ipympl 以使用 %matplotlib 小部件魔法。

How can I fix the trust issues in this install?如何解决此安装中的信任问题?

Ubuntu 20.04, python 3.9.2, jupyterlab 3.0.9 Ubuntu 20.04,python 3.9.2,jupyterlab 3.0.9

Please refer to https://ipython.org/ipython-doc/dev/notebook/security.html which explains the security in iPython noteebook.请参阅https://ipython.org/ipython-doc/dev/notebook/security.html ,其中解释了 iPython 笔记本中的安全性。 As mentioned in the article, one of the option to make html text as trusted is to explicitly mark it trusted by executing the following line in command-line如文章中所述,将 html 文本设置为受信任的选项之一是通过在命令行中执行以下行来显式将其标记为受信任

ipython trust /path/to/notebook.ipynb ipython 信任 /path/to/notebook.ipynb

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM