How to Enable Jupyter Notebook Notifications

Jupyternotify is a Jupyter Notebook extension that provides a browser notification when a code cell is done executing.

Written by Parul Pandey
jupyter-notification-when-done
Image: Shutterstock / Built In
Brand Studio Logo
UPDATED BY
Brennan Whitfield | Sep 15, 2025
Summary: Jupyternotify is a Jupyter extension that provides browser notifications when a code cell finishes execution. It works for both Jupyter Notebook and Jupyter Lab and can be installed via pip directly in a notebook.

When working in Jupyter Notebook, it can be common for a code cell to take a long time to run, especially for tasks like machine learning model training or hyperparameter optimization — which is where Jupyter Notebook notifications can be helpful.

Jupyternotify is a Python package and Jupyter extension that sends a browser push notification when a code cell execution process has finished in a Jupyter notebook, so you can focus on other tasks in the mean time and still know when code is done running.

What Is Jupyternotify for Jupyter Notebook?

Jupyternotify is a Jupyter Notebook extension that notifies the user once a long-running cell has finished executing through a browser notification. Jupyternotify is supported by Google Chrome and Firefox.

In this article, I’ll show you how to enable notifications in Jupyter Notebook and Jupyter Lab using jupyternotify.

Related10 Python Image Manipulation Tools You Can Try Today

 

Push Notifications from Jupyter Notebook After Code Execution. | Video: 1littlecoder

What Is Jupyternotify?

Jupyternotify is a Jupyter Notebook extension that notifies the user once a long-running cell has finished executing through a browser notification. It is supported by both Google Chrome and Firefox. However, if you face any issues regarding the installation, you can follow these detailed instructions to get things up and  running.

Let’s now see how we can install the package and use it.

How to Install Jupyternotify

You can install the stable version of jupyternotify from PyPI by using pip directly in your Jupyter notebook:

pip install jupyternotify

Alternatively, if you need the latest development features, you can install it from the source code on GitHub. Note that this method may be less stable and requires additional steps:

git clone [email protected]:ShopRunner/jupyter-notify.git
cd jupyter-notify/
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
jupyter notebook

Related4 Python Tools to Simplify Your Life

 

How to Turn On Notifications in Jupyter Notebook With Jupyternotify

To enable the jupyternotify extension in Jupyter Notebook, you must first load the magic command by running:

%load_ext jupyternotify

This command prepares your notebook to use the extension’s features, like the %%notify magic.

When you run this cell for the first time, your browser will ask you to allow notifications in your notebook; click “Yes.”

Now we’re all set. 

Jupyternotify Example

For a simple demonstration, we’ll use Python’s time module.

First, import the module, and then use the time.sleep() function to pause the execution. The %%notify magic command is a cell magic, which means it’s placed at the very top of a cell to apply to all the code within it.

%%notify
import time
time.sleep(10)
print('Finished!')

On executing the above cell, you’ll get the following notification in your browser:

jupyter-notification-when-done

In many browsers, clicking the notification body will take you directly to the browser window and tab where your notebook is running. However, this behavior can sometimes vary depending on your browser and operating system settings.

 

How to Turn On Notifications in Jupyter Lab With Jupyternotify

While there is currently no official jupyternotify support for Jupyter Lab, I found a workaround. Apparently, a user has submitted a pull request with the solution, but it hasn’t been merged yet. However, the solution works seamlessly.

upyter-notification-when-done
Source

Paste the following in a Jupyter Lab cell followed by the code you wish to run:

!pip uninstall jupyternotify -y
!pip install git+https://github.com/cphyc/jupyter-notify.git
%reload_ext jupyternotify

We’ll now use the same code as above to check if the notifications are enabled or not.

%%notify
import time
time.sleep(5)

Related5 Ways to Write More Pythonic Code

 

How to Customize Jupyternotify Browser Notification Message

If you wish to have a fancier notification message, you can easily tweak the code to do so.

%%notify -m "Congrats.The process has finished"
import time
time.sleep(3)
jupyter-notification-when-done

Many other options are available. For instance, you can fire a notification in the middle of a cell or automatically trigger the notification after a certain time. I highly encourage you to check out the package’s GitHub repository for detailed information.

A feature as trivial as a notification can be beneficial, especially when you regularly work with processes that take a lot of time to execute. It’s pretty handy to be able to navigate to another tab or even a desktop and still get notified when a running process finishes. Sometimes, small add-ons like Jupyter Notify can really help to increase your productivity and smooth out your workflow.

Frequently Asked Questions

jupyternotify is a Jupyter extension that sends a browser notification once a code cell has completed its execution. This is particularly useful for tasks like machine learning model training or complex data computations that can take a significant amount of time.

You can install the jupyternotify extension by using pip directly in a Jupyter notebook:

pip install jupyternotify

After installing the jupyternotify extension, load it by running the following command in a code cell at the beginning of your Jupyter notebook:

%load_ext jupyternotify

Afterward, you can use the %%notify magic command at the top of any cell to get a notification when its execution is complete.

Explore Job Matches.