Jupyter Quick Install for Scientists

Ivar Thorson bio photo By Ivar Thorson

Python is a good language, but its tooling (like pip, conda, setup.py, setup.cfg, requirements.txt, and the awkward support for binaries needed for libraries like scipy, keras, etc), leaves much to be desired. And for most scientists, it’s simply not interesting using all these build tools when you just want to get coding quickly on a new machine.

The most simplest, most reliable way I’ve found to get jupyter installed is to first install docker. Then we just run a single command – please replace /path/to/my/notebooks with your actual local directory full of notebooks, before running it though!

docker run --rm -p 8888:8888 --mount type=bind,source=/path/to/my/notebooks,target=/home/jovyan/work --name my-py-notebook jupyter/scipy-notebook

Now browse to http://localhost:8888, and copy in the token that was just printed out in the terminal you just started.

The stuff saved in /path/to/my/notebooks will be persisted, but the docker container will be closed when you are done with it. Stop the container by typing this in a new terminal:

docker stop my-py-notebook

References

  1. https://github.com/jupyter/docker-stacks