Created
February 21, 2015 11:03
-
-
Save stnbu/e7fe5cf02320793371a8 to your computer and use it in GitHub Desktop.
Using your brew-installed wxpython with a virtualenv
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
### rename orig python binary | |
# cd ~/virtualenv/bin | |
# mv python2.7 python2.7.orig | |
### create ./python2.7 | |
#!/bin/sh | |
PYVER=2.7 | |
PYTHON=/Library/Frameworks/Python.framework/Versions/$PYVER/bin/python$PYVER | |
ENV=`$PYTHON -c "import os; print os.path.abspath(os.path.join(os.path.dirname(\"$0\"), '..'))"` | |
export PYTHONHOME=$ENV | |
exec $PYTHON "$@" | |
# chmod 0755 ./python2.7 | |
### rename orig activate script | |
# mv activate activate.orig | |
### create ./activate | |
deactivate > /dev/null 2>&1 || true | |
source ~/virtualenv/bin/activate.orig | |
PYVER=2.7 | |
export PATH=~/virtualenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin | |
export PYTHONPATH=/usr/local/lib/python$PYVER/site-packages | |
### now as usual, you can... | |
# source ~/virtualenv/bin/activate | |
# python /some/wxpy_script.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment