Jupyter Notebooks fail to load in Github Gist

#1

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.

#2

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/).

-Jon

#3

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.

#4

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).
-Jon

#5

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.

#6

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.

Thanks

1 Like