52

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.

2
  • 1
    Don't forget to refresh the browser page Commented Nov 18, 2016 at 18:03
  • The currently selected Jupyter theme maybe found in this file: ~/.jupyter/custom/current_theme.txt Commented Oct 19, 2022 at 19:36

14 Answers 14

94

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

Sign up to request clarification or add additional context in comments.

4 Comments

I get command not found: jt when i use jt -r. How do I reset to default theme?
@TheTank you should install jupyterthemes before
@TheTank also if you had a virtual environment activated when you pip-installed it, make sure you are in the same virtual environment when you UN-install it!
I couldn't pip install jupyterthemes, instead conda install -c conda-forge jupyterthemes works :)
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.

Comments

18

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.

Comments

14

In order to reset your theme type in cmd

jt -r

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

Comments

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!!!

Comments

6

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

!jt -t oceans16 (my choice) !jt -r 

Comments

4

in Anaconda prompt simply run jupyter then, jt -r

Comments

3

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

Comments

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

Comments

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.

Comments

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.

1 Comment

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.
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.

Comments

0

try to run this

! jt -r 

then refresh to Jupiter notebook

Comments

-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 .

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.