Change theme in Jupyter notebook?

I like dark themes. However, the default theme for Jupyter laptops is light, and I cannot find an option to change the theme / background color. How to do it?

+116
source share
10 answers

This is easy to do with Kyle Dunovan's jupyter-themes package. You can install it using conda . Otherwise, you will need to use pip .

Install it with conda:

 conda install jupyterthemes 

or item

 sudo pip install jupyterthemes 

Then change the theme with

 jt -t chesterish 

To download themes chesterish or any other. Finally, reload the page. The docs and source code are here: https://github.com/dunovank/jupyter-themes

download topic list

 jt -l 
+169
source

Follow these steps: -

pip install themes.

 pip install jupyterthemes 

Then select the themes from the following and install them using the following command: After a successful installation, many of us thought that we need to start the jupyter server again, just refresh the page. Set Theme

 jt -t <theme-name> 

The list of topic names

  • onedork
  • class 3
  • oceans16
  • chesterish
  • monokai
  • solarizedl
  • solarizedd
+46
source

You can do this directly from an open notebook:

 !pip install jupyterthemes !jt -t chesterish 
+24
source

After I changed the subject, he behaved strangely. The font size was small, I do not see the toolbar, and I really did not like the new look.

For those who want to restore the original theme, you can do it as follows:

 jt -r 

You need to restart Jupyter the first time you start it, and then just upgrade it to include a new theme.

or straight from the laptop

 !jt -r 
+21
source

Instead of installing the library inside Jupyter, I would recommend that you use the Dark Reader extension- https://chrome.google.com/webstore/detail/dark-reader/eimadpbcbfnmbkopoojfekhnkhdbieeh in Chrome (the Dark Reader extension can be found in other browsers like Firefox). You can play with him; Filter out the URLs that you want to have a dark theme, or even how you define a dark theme for yourself. The following are some examples:

enter image description here

enter image description here

I hope this helps. Behrouz

+8
source

To install the Jupyterthemes package directly using conda, use:

 conda install -c conda-forge jupyterthemes 

Then, as others have noted, change the theme using jt -t <theme-name>

+5
source
 conda install jupyterthemes 

I did not work in Windows. I use Anaconda.

But,

 pip install jupyterthemes 

worked at Anaconda Prompt.

+3
source

You can follow these steps.

  1. pip install jupyterthemes or pip install --upgrade jupyterthemes to upgrade to the latest version of the theme.
  2. after that list all jt -l you topic: jt -l
  3. after that jt-t <themename> for example jt -t solarizedl
+3
source

Simple global resizing of the Jupyter font and internal & external background colors (this change will affect all laptops).

On Windows, find the configuration directory by running the command: jupyter --config-dir

On Linux, this is ~/.jupyter

Create a custom subfolder in this directory. Create a custom.css file and paste:

 /* Change outer background and make the notebook take all available width */ .container { width: 99% !important; background: #DDC !important; } /* Change inner background (CODE) */ div.input_area { background: #F4F4E2 !important; font-size: 16px !important; } /* Change global font size (CODE) */ .CodeMirror { font-size: 16px !important; } /* Prevent the edit cell highlight box from getting clipped; * important so that it also works when cell is in edit mode */ div.cell.selected { border-left-width: 1px !important; } 

Finally - restart Jupyter. Result:

darker backgrounds

+1
source

Run:

 pip install jupyterthemes 

Then select a theme using

 jt -t chesterish 

Finally, start / restart with

 jupyter notebook 
0
source

Source: https://habr.com/ru/post/1272255/


All Articles