Exception Notifier for Jupyter Notebook

Sep 6, 2020
Python Titbits
Image
Description

While working on our code in Jupyter Notebook we tend to forget after a while that we working, actually running some code, but there was an exception that interrupted the long running task. 😠😢

COMEON!!!!!! NOT FAIR

We again run it and have to wait and watch for another iteration to check if the fix worked or did it not.

Such a pain. 😟

Why don't we think about a exception notifier. Wait, What?! Don't we already have a notifier? Ahh yes we do, but not an exception notifier.

Well we can use them in each the cells and all that, but that's a mess in the notebook.

We can have an extension, in the notebook where if there was an exception, we will be notified like a normal notifier does.

Why don't we think about a exception notifier. Wait, What?! Don't we already have a notifier that shows a notification at the end of a successful execution? Ahh yes we do, but not an exception notifier.

Installation

Firstly, download and unzip the source code

Activating your virtualenv is the first step (Always recommended to use virtualenv)

pip install jupyter pip install jupyter_contrib_nbextensions && jupyter contrib nbextensions install pip show jupyter_contrib_nbextensions

Get the Location path from the pervious command

Copy the exception_notifier folder to:

site-packages/jupyter_contrib_nbextensions/nbextensions/

Then run the command to install this extension:

jupyter contrib nbextensions install

Start up a jupyter notebook and navigate to the new Nbextensions tab (Image below):

Image

Select the Exception Notifier extension.

Once done with that, you can start your work with an error code and Voila!

Credits

We installed the extension with the help of Jupyter Contrib Extensions

Jupyter notebook, the best tool out there, without which we wouldn't have achieved alot of things.

✌️

Top