Skip to content

Safe mode

Notebooks

Safe mode is a code-only view of your notebook that you use to fix issues that prevent the notebook from running properly. An example of such an issue would be an infinite loop. If you have a while loop without a yield statement, it’s possible to construct the loop so that it infinitely repeats, never allowing anything else to happen. Safe mode is designed to let you fix that.

When you enter safe mode, a banner appears at the top of your notebook, making it clear that you are in safe mode:

Gold banner appearing atop a notebook in Safe mode, reading 'Safe mode enabled. Use this code-only view to fix issues that might crash or hang the normal editor'.
Use safe mode to fix problems in your notebook's code.

Also, all of the cells in your notebook display their code, rather than the results of their code. No cells are executed, allowing you to edit the code and address any problem.

Here is a notebook in safe mode. Notice how all cells are showing code:

Screen shot of a notebook in safe mode, with 'safe mode' banner up top, and each cell's code revealed (without outputs).
Notebook in safe mode.

Here is the same notebook before safe mode was enabled:

Screen shot of a notebook not in safe mode, with cells executed and outputs shown.
Original appearance of notebook.

Enabling safe mode

To enable safe mode, choose View > Enable safe mode:

Screen shot of a notebook menu, where a user navigates to Safe mode in the View options.
Enable safe mode from the View menu.

Alternatively, you can append /safe to the URL for your notebook to enter and work in safe mode.