Milky Way galaxy at night

I’m just in the middle of creating my Data Engineering portfolio which is hosted on GitHub and needed to convert a 🪐 Jupyter Notebook into HTML for one of my project pages. I know I know…you can use Kaggle or README files to showcase Data projects but I kind of wanted to play around with this first.

Here’s a quick and easy to follow step-by-step guide on how to convert Jupyter Notebooks into HTML. Once it’s in HTML you can add it to any website, web page or integrate with Bootstrap which is what I’m doing. ✌️

Converting Jupyter Notebook to HTML

First of all, Jupyter already has this command

jupyter nbconvert --to html jupyter_notebook.ipynb

But I kept getting this error

ValueError: No template sub-directory with name 'lab' found in the following paths:

Therefore, I did a little google and it was found that the ‘Templates’ folder is not included in version 6.0.0 therefore you have to roll back the version by uninstalling and re-installing nbconvert:

pip uninstall nbconvert
pip install nbconvert==5.6.1

Once this is done you re-enter first command and it should convert. your file to HTML. This conversion uses the Bootstrap framework already.

A voila! Finished.


If you found this post useful please support House Ninety Two: Buy Me a Coffee at ko-fi.com