Skip to content

Instantly share code, notes, and snippets.

@garymacindoe
Created April 6, 2017 10:22
Show Gist options
  • Save garymacindoe/ed36e5f3fe12153ffa2ced58c9ea5a70 to your computer and use it in GitHub Desktop.
Save garymacindoe/ed36e5f3fe12153ffa2ced58c9ea5a70 to your computer and use it in GitHub Desktop.
Pre/post scripts for virtualenvwrapper to enable jupyter notebook integration for virtualenvs
#!/bin/bash
# This hook is sourced after a new virtualenv is activated.
pip install ipykernel
python -m ipykernel install --user --name $(basename ${VIRTUAL_ENV}) --display-name "$(basename ${VIRTUAL_ENV})"
#!/bin/bash
# This hook is run before a virtualenv is deleted.
# argument: full path to environment directory
[[ -d "${1}" ]] && rm -rf "${HOME}/Library/Jupyter/kernels/${1}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment