Today, I Spent 2 hours Just to Change the Jupyter theme?!

Diyana Ibrahim
4 min readMar 8, 2022

But it was worth it.

me today.

A few things to clarify before I share my turmoil journey

  1. I am new to programming in general.
  2. My foundations in Python and PythonPath are still in their infancy.
  3. I almost gave up on continuing my data science journey because of this. Because I can’t change the Jupyter theme.

Ridiculous? Maybe. But here’s what I learned from it.

Before the Problem Started

So, as a visual learner, I searched for a Youtube video and followed the instructions.

Opened up Jupyter notebook, and the first thing that was strange to me was that it was required to include a ! before the command. I didn’t think much of it but proceeded with the video. After all, I just wanted a dark theme for my Jupyter notebook (so my eyes stopped screaming for help).

I installed the jupyterthemes package, then it was time to actually change the theme and customize. I was ecstatic at this point and was looking forward to seeing the changes, just like in the Youtube video.

But, I encountered an error.

Naturally, I do what I usually do. Ctrl C + Ctrl V into the Google search bar.

Unbeknownst to me, it would be the start of (almost) 2 hours of torture for me.

The Start of My Lunacy on a Sunday

I thought maybe I searched it wrongly. So, I started searching on the root of the traceback call error. I worked on it for a bit (foggy on what I did but involved many relaunching Jupyter from Anaconda).

Then, I tested the jt command [!jt -h] to get a help output. The error was that the zsh: command was not found: jt. Almost an hour in, I was getting agitated.

But I refused to take a break without finding a solution.

So, like a dumbass, I persevered. Downed a large gulp of water and was ready for Round 2.

The next hour into this is what I would call The Magic Hour. It’s magical because I learned something new, and I know it is a foundation often left out in beginner Python courses. (In fact, it was never mentioned in any courses I took so far)

I was frustrated at first until I found this magical GitHub page.

Key Takeaways that I Learned

On Python

My jt package is not in the same location as my Python.

Using find/ -name “jt”, I found the location of my jt package, and Python is in a folder named opt.

I replaced $HOME/anaconda/bin with the path returned when I executed which Python.

Basically, I learned about PYTHONPATH and just how paths work in general.

PYTHONPATH is an environment variable you can set to add additional directories where Python will look for modules and packages. You should not put these variables for most installations since they are not needed for Python to run. Python knows where to find its standard library.

This path varies according to which operating system and Anaconda versions we use. So I need to find the correct way to my Python interpreter by searching through my file system.

On General Learning Experience

I should train myself to take a breather when I’m agitated. Learning new complex concepts is meant to be complicated. And I should not punish myself (and my brain) just because “I should be able to change Jupyter themes because it sounds easy.”

I ended up taking a more extended break than usual after this, delaying my learning path because I had to push the other topics to tomorrow.

I stopped feeling angry and decided to share it here to look back and remember what a silly little goose I am.

My Conclusion From This Experience

Learning new things is supposed to be enjoyable and challenging. But, on the bright side, I actually get to use a Jupyter notebook on dark mode! Yay!! Mission Accomplished!

I also learned a lot by reading Anaconda documentation and Github repositories. I customized my fonts, font size and other things to make my learning more enjoyable.

Let me share my success for the day!

my bootyful Jupyter notebook ❤

Dark and less eye-torture.

This was the command responsible for the layout above!

Oh, also, before I end this, I learned another valuable lesson. Minor, but helpful.

Earlier, I said it was strange that the Youtube video used an exclamation mark before the command. I know now that it is because that means that we are executing commands to the shell, and not to the Python interpreter. Basically, if I were to install the jupyterthemes package from Terminal, I wouldn’t need to include a “!” before the command.

Well, that’s it for today. Thank you so much for reading and have a great night!

--

--

Diyana Ibrahim

Provides you with daily 5 minute reads to work about books, science and Vancouver.