Skip to content

Instantly share code, notes, and snippets.

@jenshnielsen
Created May 26, 2015 14:29
Show Gist options
  • Save jenshnielsen/7a63f06a06223d180fe7 to your computer and use it in GitHub Desktop.
Save jenshnielsen/7a63f06a06223d180fe7 to your computer and use it in GitHub Desktop.
Simple script to fake a framework build of python in a virtualenv on OSX.
#!/bin/bash
# what real Python executable to use
PYVER=2.7
PYTHON=/usr/local/bin/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 "$@"
@jenshnielsen
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment