Jupyter Notebooks fail to load in Github Gist


I have successfully uploaded seaborn-related Jupyter notebooks to my github/gist repo.
They render correctly on github. In this case, I saved the notebook with all cells executed and charts rendered.

When trying this with a notebook that is plotly-based and the cells have been executed prior to saving, they do not load on github/gist.

I suspect that there is a security-related issue on the github side that blocks the notebook from coming in due to the javascript that is embedded in the notebook.

When I use non-executed notebook cells throughout, it does load and I can see the whole notebook. It just doesn’t contain the rendered cells.

My workaround will be to instruct the user to execute the cells in a notebook viewer in order to see them. Not a big deal, just something to share with the community.


Hi @thoughtsociety,

I don’t have the reference at hand, but GitHub explicitly states somewhere that their notebook preview doesn’t support HTML components. The easiest workaround I’ve found is to provide users with an nbviewer link to the notebook (https://nbviewer.jupyter.org/).



My objective is to provide a link to a downloadable notebook and nbviewer does not show the rendered cells even when I upload a notebook where the cells were executed and saved that way.


Here’s an example of notebook stored on GitHub (https://github.com/plotly/plotly_express/blob/master/walkthrough.ipynb) and rendered on nbviewer (https://nbviewer.jupyter.org/github/plotly/plotly_express/blob/master/walkthrough.ipynb).


I have been storing my notebooks as ‘gists’ on github and then providing the sharing link to nbviewer to view them.
But as I said, I cannot successfully get rendered notebooks to load on github.


I was able to get this to work by creating a regular repo, adding the ipynb file and committing it instead of using a gist.
Then I copied the url of this notebook from github to Nbviewer and it renders successfully although a little sluggish.
It was a heavy notebook.


1 Like