Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jupyter: disable restart kernel warning

I'm using jupyter 4.1.0, and I find myself making frequent use of the "Restart & Run All" feature. Every time I use that button it displays this warning:

enter image description here

Is there a way to disable that warning?

like image 902
Mister Brainley Avatar asked May 26 '16 22:05

Mister Brainley


People also ask

How do I turn off Jupyter notebook warnings?

You can suppress all warnings in the jupyter notebook by using the warnings module and using functions like 'simplefilter()' and 'filterwarnings()'.

How do I stop the Anaconda prompt in Jupyter notebook?

NOTE: You can also shutdown a Jupyter Notebook session by clicking in the Terminal window and clicking Ctrl+c . You will be asked to confirm that you want to Shutdown this notebook server (y/[n])? . Type y and hit Enter to confirm. Then, you can close the Terminal by typing the command exit and hitting Enter .

What is Ipykernel in Jupyter notebook?

The IPython kernel is the Python execution backend for Jupyter. The Jupyter Notebook and other frontends automatically ensure that the IPython kernel is available. However, if you want to use a kernel with a different version of Python, or in a virtualenv or conda environment, you'll need to install that manually.

What does restarting Jupyter kernel do?

You can restart your Jupyter Kernel by simply clicking Kernel > Restart from the Jupyter menu. Note: This will reset your notebook and remove all variables or methods you've defined! Sometimes you'll notice that your notebook is still hanging after you've restart the kernel. If this occurs try refreshing your browser.


1 Answers

You can add a cell in your notebook and using the following statements:

from IPython.core.display import HTML
HTML("<script>Jupyter.notebook.kernel.restart()</script>")

And the kernel will restart immediately.

like image 171
kingbase Avatar answered Sep 21 '22 13:09

kingbase