Is it possible to restart an ipython
Kernel NOT by selecting Kernel
> Restart
from the notebook GUI, but from executing a command in a notebook cell?
You can run the whole notebook in a single step by clicking on the menu Cell -> Run All. To restart the kernel (i.e. the computational engine), click on the menu Kernel -> Restart.
Be sure to activate the environment in the terminal using the command conda activate earth-analytics-python before running the jupyter notebook command. When you type this command into the terminal, it will launch a local web server on your computer. This server runs the Jupyter Notebook interface.
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.
As Thomas K. suggested, here is the way to restart the ipython
kernel from your keyboard:
import os os._exit(00)
import IPython IPython.Application.instance().kernel.do_shutdown(True) #automatically restarts kernel
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With