Jupyter Notebook syntax highlighting not working
Asked Answered
K

5

7

I recently installed Anaconda 3 and after a few minor issues I was able to run Jupyter Notebook, but syntax highlighting is not working at all. Everything else seems to be working fine.

I had Anaconda 2 installed before, deleted all it's directories (with jupyter's dirs along with it) prior to downloading and installing Anaconda 3.

I don't think this forced-uninstall of Anaconda 2 is the reason for this problem because Anaconda 3 files should all be contained in its installation, right?

Keeper answered 1/3, 2019 at 20:58 Comment(0)
I
7

I'm not sure if it will help, but let it be here for history. I use Anaconda 3 on windows 10 (64), Jupyter syntax always worked (Google Chrome browser). Today I launched QtConsole before Notebook. Any actions inside QtConsole were performed AFTER I opened Notebook and saw a lack of syntax highlight. So it doesn't matter what exactly I did inside the console. I've noticed that problem was fixed after the following sequence: I closed QtConsole and I've restarted Kernel via upper menu (Kernel => Restart and Clear Output).

Interdepartmental answered 28/8, 2019 at 9:47 Comment(3)
I only had to do this; "Kernel > Restart and Clear Output" worked for me! ThanksPneumectomy
I have this problem as well (i.e. syntax not highlighted on notebook cells) and this worked! For future reference, I also had a previous installation of anaconda (on windows), something went wrong, so I uninstalled and installed miniconda, aaaaaand the problems started.Heffner
In my case I had to toggle dark reader off then on again.Blunder
C
2

Try to hard refresh the browser On MacOS is command + shift + R (open your browser first) Find the equivalent for your OS

Cockroach answered 15/2, 2024 at 10:52 Comment(0)
N
0

I was facing the same issue on using jupyter notebook on Microsoft edge, but as soon i Shifted to google chrome it got resolved automatically

Nancinancie answered 21/7, 2024 at 8:32 Comment(0)
A
0

I recommend to run it on a local server IP (different port), the colorization returned when I did that.

Aslant answered 28/9, 2024 at 13:3 Comment(1)
I removed what obviously is not answering. What remains however still needs some explanation on how it is meant to be an answer to the question at the top of this page. Please edit and try for How to Answer.Depose
L
-2

I had this same issue. If you go up to the menu bar of your kernel window, the very last item in the menu bar will have either "Raw" or "Markdown"

Click on it and change it to "Code" and this should resolve the issue

Livonia answered 19/11, 2020 at 0:58 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.