Last updated: Apr 12, 2024
Reading time·3 min
The Jupyter Notebook "Not Trusted" issue is caused because of a security feature that disables the execution of code from untrusted notebooks, without the user's consent.
You can resolve the issue by issuing a command to trust the notebook or by using the graphic user interface to achieve the same.
One way to resolve the issue is to use a command.
Open your terminal in the same directory as your notebook and issue the
jupyter trust
command.
jupyter trust my-notebook-name.ipynb
Make sure to replace the my-notebook-name.ipynb
placeholder with your actual
notebook name.
You can find the notebook name by:
.ipynb
file in your project's directory.For example, my notebook is named my-notebook.ipynb
, so I will issue the
following command.
jupyter trust my-notebook.ipynb
Then you can reopen the notebook by using the jupyter notebook
command.
jupyter notebook my-notebook-name.ipynb
Make sure to replace the my-notebook-name.ipynb
placeholder with your actual
notebook name.
The jupyter trust
command tells Jupyter to trust your notebook.
You can also resolve the issue by using the Jupyter Notebook GUI:
jupyter-notebook
or jupyter notebook
command.jupyter notebook
If you see the "Trusted Notebook" option when you click on File, then your Notebook is already trusted.
You can also resolve the issue by clicking on the "Note Trusted" label.
After you click on it, you will be prompted for confirmation.
Click on "Trust".
You can also use the "Trust Notebook" command to resolve the issue.
If you use Jupyter Lab, click on View in the top menu and then select
Activate Command Palette or press Ctrl
+ Shift
+ C
.
You might also be able to open the Command Palette by pressing Ctrl
+
Shift
+ P
.
Then type "Trust Notebook" in the command palette and issue the command.
You might also get the error if you create a Notebook in a Docker container with a mounted volume.
The notebook file is owned by the root user, so if you open it in Jupyter on the host machine, it won't be trusted.
In this case, you have to change the ownership of the notebook .ipynb
file to
the host user.
You can learn more about the related topics by checking out the following tutorials: