Tip: Dark mode for Jupyter Notebooks

Subscribe to my newsletter and never miss my upcoming articles

If this was an article it would be entitled Theming Jupyter notebook. However, since it falls in the tip category, I'll make it short hence the current title.

Jupyter makes code writing interactive and allows you to publish as you would an article. You can teach with it, learn on it and publish a notebook/s on several platforms like Github and Google Colab (examples linked).

A notebook is usually plain white like this:

Installation

After going through the installation guide here simply run pip install jupyterthemes and jt -t onedork (in the same virtual environment) before starting the notebook.

The complete list of commands to run in your terminal or command prompt:

pip install jupyter
pip install jupyterthemes
jt -t onedork
jupyter notebook

Then click on the link in the output starting with the following: http://localhost:8888/?token= ...

Before:

plain-jupyter-themeplain-jupyter-theme

After:

jupyter-dark-modejupyter-dark-mode

To reset simply kill the server, Ctrl+C then run jt -r. More details are in the jupyter-themes' github page.


S/O to Jee, the Whimsical software engineer who has been a colleague for almost 4 years now for this tip.

This gist for All things Python has proved useful overtime for me, help yourself to it. Feedback is welcome.

Catch more tips here.

No Comments Yet