• Email
    • GitHub
    • LinkedIn
    • Medium

Leah Erb

Breadcrumbs of a Data Engineering Student

  • Blog
  • Techie Tidbits
    • AWS
    • Python
    • R
    • GitHub
  • About

Jupyter Notebook doesn’t render on GitHub? Use nbviewer.

October 8, 2019

You attempt to open a Jupyter Notebook in your GitHub repository and get the dreaded ‘Sorry, something went wrong. Reload?’ message. Dang!

GitHub message 'Sorry, something went wrong. Reload?'

Your notebook is probably ‘too big’. Even if your code cells are not especially large, lengthy output could push it over the edge into ‘too big’.

Fortunately, you have options. One super-cool and free option is nbviewer, which renders your Notebook on GitHub for you.

Example Use Case

1. Open your GitHub repository and find the .ipynb file.

Example GitHub repository file listing

2. Get the file’s URL. (Right-click the filename then ‘Copy Link Address’, or click the filename and get URL from the browser’s address bar.)

3. Go to https://nbviewer.jupyter.org/

4. Paste the file’s URL, then click ‘Go!’. 

nbviewer.jupyter.org homepage

5. nbviewer will create a static HTML version of your Notebook. Beautiful! Copy its URL from the browser’s address bar.

Example rendering of Jupyter Notebook using nbviewer

6. Now what? I add the rendering’s URL to my README file. You have may have more clever ideas.

Example README.md with nbviewer link

 

Example README.md code with nbviewer link

Hint

After updating the Jupyter Notebook in your repository, it can take 10 minutes to see the updated nbviewer rendering. To force an update, add ?flush_cache=true to the nbviewer URL.  Like this:

https://github.com/leaherb/GoFish/blob/master/GoFish.ipynb?flush_cache=true

Reference

https://nbviewer.jupyter.org/

Filed Under: GitHub, Techie Tidbits

« Best introduction to Machine Learning
scikit-learn’s SimpleImputer lacks parameter for imputing across rows. Here’s a workaround. »

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Blog
  • Techie Tidbits
  • About

Copyright © 2019 · Leah Erb, Data Science Student