简体   繁体   中英

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. The trust shield icon then changes from a check mark to an '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'. Hovering over the shield icon gives the text: Notebook not trusted, 1 of 2 cells trusted. In a longer notebook, every markdown cell is counted as untrusted.

Running

jupyter trust testTrust.ipynb

gives

ERROR | Notebook missing: testTrust.ipynb

This is a new install in a new virtual environment, installed through miniconda:

    conda install -c conda-forge jupyterlab nodejs ipympl

where inclusion of the nodejs package was triggered by a previous install attempt giving:

Could not determine jupyterlab build status without nodejs

at launch, and ipympl was included for use of %matplotlib widgets magic.

How can I fix the trust issues in this install?

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. 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

ipython trust /path/to/notebook.ipynb

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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