How to Interrupt the Kernel If the Jupyter Notebook is not responding

If the Interrupt Kernel Does not work then use the following alternative approach

1. Restart the kernel

We can restart the entire jupyter notebook kernel using the Restart Kernel option from the Kernel menu

  1. Go to Kernel menu
  2. Click on Restart to restart the kernel
  3. This will terminate the current kernel and restart again.

2. Stop the Jupyter Notebook Server

Kill the server of the notebook from the terminal and open the notebook again

To kill the server from the terminal follow the steps below

Method 1

Just stop the port of the notebook server by the following the steps

To know on which port the server is running click on the url on the current jupyter notebook is running:

For example the url will be :

http://localhost:8888/tree/PawanKrGunjan

The number displayed after the ‘http://localhost:’ is the PORT number.

From the above we can see the port i.e 8888 here enter the following command to stop the server

jupyter notebook stop <PORT>

To enter the following command we will the follow the following steps:

  1. Open the new terminal and lanch the active the python on which the current jupyter notebook is running.
  2. Enter the below command “Jupyter notebook stop 8888

Jupyter Server Stopped by using PORT

Here I have put the port 8888 to stop the notebook server

Method 2

Open the same terminal window and Just press Ctrl+C to stop the server in the terminal window where it is running

For windows, it will directly stops

In Linux, it will ask for reconfirmation like for 5 seconds:

Shutdown this notebook server (y/[n])?

To stop the notebook server, press Y with in the 5 seconds:

Stopping the server

Stop the Jupyter Kernel if Kernel is not responding

Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations, and narrative text. Google Colab and Kaggle Notebook are inspired by it. Data transformation and cleaning, statistical modelling, data visualization, machine learning, and many other applications are just a few examples. In the article, we will understand how to install Jupyter Notebook, why it is important to stop a cell, How to interrupt a kernel to stop a cell, Understand kernel interruption, etc.

Similar Reads

Why Does the Jupyter Kernel Become Unresponsive?

Before we go into the answer, it’s important to understand why a Jupyter kernel could stop responding. Several variables can contribute to this problem:...

Interrupt a Kernel to Stop a running cell

Sometimes it can happen that a particular cell goes into infinite loop to stop this click on the Kernel menu then Click on Interrupt Kernel...

How to Interrupt the Kernel If the Jupyter Notebook is not responding

If the Interrupt Kernel Does not work then use the following alternative approach...

Kill the kernel and Restart Automatically

To kill the kernel and restart automatically first we need the Process ID i.e PID...

Issues with kernel Interruption

...

Contact Us