51

I'm using the jupyter notebook installed with Anaconda (I'm on Mac). Few days ago, I wanted to change the theme to have a dark background, and I followed the instructions here. Namely, I've downloaded the theme custom.css and placed it in ~/.jupyter/custom/. It worked very well.

I liked the theme, but I would like to go back to the default one (this one does not show the main toolbar, among other things). I tried to remove the custom.css from its folder, I reset my terminal, but nothing changes! I'm guessing that jupyter keeps a copy of the themes somewhere that I should delete, but I can't find it.

I have also tried uninstalling jupyter and reinstalling, following the commands:

conda update conda
conda uninstall ipython
conda install jupyter

Again, no change. I'm stuck with my black background theme with no toolbar.

Thomas K
  • 39,200
  • 7
  • 84
  • 86
marguerite
  • 643
  • 1
  • 5
  • 9

14 Answers14

90

An easier way might be to do:

pip install jupyterthemes

Now you can choose from the following given themes and activate it like this

# list available themes
# onedork | grade3 | oceans16 | chesterish | monokai | solarizedl | solarizedd
jt -t <THEME_NAME>

In order to reset your theme to the default theme just use

jt -r

For all information and more, visit github.com/dunovank/jupyter-themes

starball
  • 20,030
  • 7
  • 43
  • 238
M. Glombek
  • 951
  • 1
  • 6
  • 6
19

I am hoping that you used pip install jupyterthemes to get the custom themes.

The following are the steps that take you from installation of new themes to the resetting of the same to default.

pip install jupyterthemes 

jt -l (List of all themes)

jt -t <THEME NAME> (to implement a theme)

jt -r (to reset the notebook to default)

Hope this helps.

Pragyaditya Das
  • 1,648
  • 6
  • 25
  • 44
18

My previous suggestion of deleting the custom/ directory doesn't do the trick. jupyter caches the custom.css file in other directories that are tricky to clear all together. If it doesn't find a folder custom with .css file inside it it looks in other locations to pick up a .css file. Also, I'm not sure if every location is actually deleted when you uninstall jupyter.

The easiest solution is to delete the old custom.css and replace it with a new empty custom.css file. jupyter picks that up and goes back to its default look.

Dimitris Fasarakis Hilliard
  • 150,925
  • 31
  • 268
  • 253
15

In order to reset your theme type in cmd

jt -r

delete the directories returned by console. Now restart the notebook server.

Eswar Chitirala
  • 486
  • 6
  • 14
10

Close any instances of jupyter notebook. Open Anaconda prompt. Run "pip install jupyterthemes" This should show you the themes installed/ cached by jupyter notebook.

Running pip install jupyterthemes

Now run "jt -r" to reset the theme to default as shown below.

enter image description here

Open and test jupyter notebook. Theme should be gone now. Cheers!!!

Shubhdeep Singh
  • 407
  • 6
  • 7
6

On windows running jt from the notebook, one has to precede the jt command with the !.

!jt -t oceans16 (my choice)

!jt -r 
LetzerWille
  • 5,355
  • 4
  • 23
  • 26
4

in Anaconda prompt simply run jupyter then, jt -r

3

in command prompt type jupyter then press enter and then type jt -r it will surely work

2

If you are having trouble viewing the tool bar you can put this code in:

!jt -t solarizedd -T -N -kl

Where: Toolbar Visible -T Name & Logo Visible -N Kernel Logo Visible -kl their defaults are set to none

dboy
  • 1,004
  • 2
  • 16
  • 24
Shawn Jamal
  • 170
  • 8
0

I'm a newbie and had problems with all of the above solutions and all I wanted was to set it back to default. I was stuck in a dark mode theme. Instead, I found that going to C:\Users\"Username_Here"\anaconda3\Lib\site-packages and finding the "jupyter themes" folders and deleting them entirely. Set everything back to default. There were 2 folders to delete.

0

I was actually trying to change the font size of the dark theme and wrote the command - jt -fs 200 and it actually changed the theme back to the default one.

Dharman
  • 30,962
  • 25
  • 85
  • 135
  • 1
    It works probably but it isn't a proper way to solve the problem because the reason is a bug - the `-fs` flag should only change font size as you tried to. – maciejwww Mar 06 '22 at 02:47
0

You don't need to reinstall jupyter-notebook, the problem is with jupyterthemes.

You can reset current theme to default with: jt -r,
or just set the same theme with prefered flags which enable:

  • toolbar: -T
  • filename and logo: -N
  • kernel logo: -kl

e.g. !jt -t monokai -T -N -kl


If you don't like the new shape jupyterthemes imposes on jupyter-notebook, I can recommend jupyter-themer which is easier to use and is not effecting the default shape of jupyter-notebook at all.

Installation: pip install jupyter-themer

Repositorium with documentation and examples (*for now, examples are stored in a not merged pull-request): @github: jupyter-thamer

My favourite customization: jupyter-themer -b dark -c zenburn.

maciejwww
  • 1,067
  • 1
  • 13
  • 26
0

try to run this

! jt -r

then refresh to Jupiter notebook

Itay Guy
  • 111
  • 1
  • 6
-3

Just go to the c drive and users directory. there you can see jupyter directory . delete it completely and freshly again start jupyter notebook by clicking ananconda shell. that is all needed. simple issue .

joshy
  • 1