Skip to content

Instantly share code, notes, and snippets.

@bdmorin
Created June 27, 2018 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdmorin/78a6c3e6992884d2064896f70c360617 to your computer and use it in GitHub Desktop.
Save bdmorin/78a6c3e6992884d2064896f70c360617 to your computer and use it in GitHub Desktop.
virtualenv for jupyter
#!/bin/bash
# Yes you can do this in ansible
jdir = "~/jupyterLocal"
mkdir -p ${jdir}
pip install virtualenv
pip install virtualenvwrapper
TMPFILE=$(mktemp)
cat << EOF > ${TMPFILE}
export WORKON_HOME=$HOME/.virtualenvs
#export PROJECT_HOME=$HOME/Devel
export VIRTUALENVWRAPPER_SCRIPT=/usr/local/bin/virtualenvwrapper.sh
source /usr/local/bin/virtualenvwrapper_lazy.sh
EOF
source ${TMPFILE}
cat ${TMPFILE} >> ~/.zshrc
mkvirtualenv jupyterLocal -p python3
workon jupyterLocal
PIPS=(
appnope
html5lib
ipykernel
ipython
ipython-genutils
jsonschema
jupyter-client
jupyter-contrib-core
jupyter-contrib-nbextensions
jupyter-core
jupyter-highlight-selected-word
jupyter-latex-envs
jupyter-nbextensions-configurator
jupyterlab
nbconvert
nbformat
notebook
numpy
matplotlib
pep8
pyflakes
Pygments
python-dateutil
PyYAML
)
for P in ${PIPS}
do
pip install ${P} -U
done
echo "cd ${jdir}" >> $VIRTUAL_ENV/bin/postactivate
workon jupyterlocal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment