Lost colorization in Jupyter Notebook

Anaconda3 is installed and updated with all the latest versions ov serval apps including JupyterLab and Jupyter.

JupyterLab operates without problems, but Jupyter has lost all colorization. No syntax colors for code or markup; all is in black and white. Sometimes, rarely, the colorization for Jupyter returns after app startup.

Is there an easy fix for this?

I’ve considered uninstalling Jupyter via conda and then reinstalling, but I have a long-running cell in JupyterLab that I don’t want affected.

Will uninstalling Jupyter via conda and then reinstalling affect a running JupyterLab?

It could be a problem with your browser. Have you tried clearing your browser cache and/or site settings? You could also test using an incognito window since that should ignore your existing browser cache.

@manics
Cleared cache; didn’t solve issue.

Jupyter would not launch to the incognito window!

Are there any errors in your browser devtools console?

Otherwise it might be worth creating a new conda env, installing Jupyter from scratch and running it on a different port. That way you can test without interrupting your long-running notebook.

@manics

Although clearing the browser cache had no effect “initially”, it appears you may be correct about the browser being the culprit. Suddenly, after about 30+ minutes of use, the notebook regained colorization.

It’s still can’t definitively identify what the cause is though. I’ll keep working on it.

If needed, I’ll follow you additional suggestion.

Thank you so much for you helpful insight!

Same here, manual restore of colorization by changing EACH cell to “markdown” and then back to “code”

1 Like

Simply closing the notebook and restarting it solved the case for me.

Selecting all the cells, cutting them, and pasting them back worked for me.

This happened to me as well. If you go to the top of the kernel window, look at the last item in the menu bar. If it reads “Raw” or “Markdown” click on it and change it to “Code”. If this doesn’t resolve the problem then try the other ideas listed on the site.

1 Like

Same problem in Firefox. I find that refreshing the page right after the notebook launches does the trick, but still looking forward to a long term solution. Thank you all!

In my case, the culprit was a Safari extension called ‘NightLight’ (which allows to force a webpage into dark mode). I recovered the colorization as soon as I disabled this extension and reloaded the page.

1 Like

This also has worked for me!

1 Like

Same thing occurred with me as well and I tried all possible suggestions given above and from ChatGPT as well, but it still didn’t work. But for some other reason I ran it on my local server IP and the colorization had returned.