Last active
February 9, 2016 13:00
-
-
Save bfontaine/167b485b2d268d756633 to your computer and use it in GitHub Desktop.
PYTHONHOME script from http://matplotlib.org/faq/virtualenv_faq.html (I’m not the author; I’m posting here so it’s easier to `curl`).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# what real Python executable to use | |
PYVER=2.7 | |
PATHTOPYTHON=/usr/local/bin/ | |
PYTHON=${PATHTOPYTHON}python${PYVER} | |
# find the root of the virtualenv, it should be the parent of the dir this script is in | |
ENV=`$PYTHON -c "import os; print os.path.abspath(os.path.join(os.path.dirname(\"$0\"), '..'))"` | |
# now run Python with the virtualenv set as Python's HOME | |
export PYTHONHOME=$ENV | |
exec $PYTHON "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment