Teaching with Jupyter Notebooks and JupyterHub

Jess Hamrick
Min RK
Kyle Kelley

Go here and add your GitHub username!


Or find it from my Twitter feed (@jhamrick)

(or google for rackspace jupyterhub)

I'm going to tell you a story

  • About teaching with notebooks
  • And nbgrader
  • Also JupyterHub

Computational models of cognition

a.k.a. "compmodels"

Assignment structure

  • Background material
  • Instructions and examples
  • Coding exercises
  • Plotting exercises
  • Written interpretation of results

Original assignments

  • Zip archive of assignment files
  • PDF with instructions, some Matlab files, and some text files


  • Inconsistent instructions
  • Mismatch between solutions and student version
  • Encoding issues
  • Renamed and missing files
  • Autograding in Matlab is horrible

How to improve the assignments?

Python is awesome!

Jupyter notebooks are awesome!

I should use them for our assignments!

... how do I grade them?

Solution: nbgrader

  • Stands for "notebook grader"
  • Tools for creating, releasing, collecting, and grading notebook assignments

Example Assignment

Challenges with notebooks

  • Students will need help installing Jupyter
  • Difficult to ensure everyone has the same library versions
  • Libraries may need to be updated after the course has started
  • Some students will submit assignments incorrectly
  • 200+ students is a lot!

Solution: JupyterHub

  • Service that authenticates users and launches separate Jupyter notebook servers for each user
  • Cross-platform
  • Exactly the same environment for all students
  • Can update software versions in the middle of the semester
  • Easy to distribute/collect assignments


  • Scaling to ~220 users
  • Isolating user environments
  • Persistent home directories

Solution: Docker + NFS

JupyterHub demo

How it works

How it works

How it works

How it works

How it works

How it works

How it works

How it works

How it works

How it works

How it works

How it works

So, how'd it go?

  • Having identical environments is super convenient
  • Students really liked working with the notebook
  • Developing good, testable assignments is hard
  • Don't let the server crash during the final


Jupyter + Education BoF

Friday, 1-2pm, Room 204

Jupyter and IPython BoF

Friday, 5:30-6:30pm, Grand Ballroom