122

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

enter image description here

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

Jean-François Corbett
  • 37,420
  • 30
  • 139
  • 188
Clément F
  • 3,535
  • 6
  • 18
  • 26

7 Answers7

153

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
Jean-François Corbett
  • 37,420
  • 30
  • 139
  • 188
Vincent Pakson
  • 1,891
  • 2
  • 8
  • 17
67

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 about it https://jupyter-notebook.readthedocs.io/en/stable/security.html#security-in-notebook-documents

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

Ellie Kesselman
  • 899
  • 1
  • 17
  • 34
Anis
  • 2,984
  • 17
  • 21
  • 3
    Cannot suggest edit, so leaving a comment here. The link is dead. It can be replaced with this one: https://jupyter-notebook.readthedocs.io/en/stable/security.html#security-in-notebook-documents – user47 Aug 18 '22 at 10:13
24

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

Baban Gain
  • 614
  • 6
  • 21
  • 1
    I think jupyter lab latest release 1) this popup never comes up and 2) you cannot chose Trust under the file menu. The only way I see to do it is what @VincentPakson stated. – Ray Jennings Oct 05 '21 at 18:59
  • 1
    Have posted that assuming usage of Jupyter notebook instead of jupyterlab. – Baban Gain Oct 06 '21 at 10:13
  • I do not have an updated version of Jupyter notebook. It would be great if someone could confirm if it works there or not. – Baban Gain Oct 06 '21 at 10:14
12

Open Notebook in Jupyter -> Click File -> Trust Notebook

Pic

Aryan
  • 430
  • 4
  • 12
7

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.

Bohumir Zamecnik
  • 2,450
  • 28
  • 23
  • I'm running my notebook on a docker and the entry-point file runs a script that runs `jupyter trust my_notebook.ipynb` and `jupyter-notebook --no-browser --ip 0.0.0.0 --port 8888 --NotebookApp.allow_origin='*' --NotebookApp.allow_remote_access=True --NotebookApp.quit_button=True --NotebookApp.trust_xheaders=True --NotebookApp.open_browser=False --NotebookApp.notebook_dir=/some/path`. The owner of all files in the docker is the same and **not** root. When I open the notebook it is still not trusted. Is there any way to fix this? – pugi Sep 08 '22 at 14:01
4

For Jupyter lab you can use the command Trust Notebook.

The command line can be accessed via View > Activate Command Palette or with Ctrl+Shift+C.

enter image description here

enter image description here

Mauricio Perez
  • 190
  • 1
  • 7
1

Accessing the Jupyter lab using the generated link with token from the Command Prompt helped, this link is something like this http://localhost:8888/lab?token=0479d86d921f46a967e3cbb3237e2c9d3210d342ef0c4ebe, copy and paste it into the address bar of your browser and enter.

Chong
  • 11
  • 3