Created
February 13, 2012 23:28
-
-
Save kroger/1821425 to your computer and use it in GitHub Desktop.
Install Python 2.7 on Mac OS
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/sh | |
#set -e | |
PYTHON_VERSION=$(brew info python | grep -o "stable 2\.7\.\d" | awk '{print $2}') | |
function install_python { | |
brew install readline sqlite gdbm | |
brew install python --universal --framework | |
} | |
function config_python { | |
FRAMEWORK=/System/Library/Frameworks/Python.framework/Versions | |
NEW_FRAMEWORK=/usr/local/Cellar/python/$PYTHON_VERSION/Frameworks/Python.framework/Versions/Current | |
sudo rm $FRAMEWORK/Current | |
sudo ln -s $NEW_FRAMEWORK $FRAMEWORK/Current | |
pip install tox | |
} | |
function install_pip_virtualenv { | |
sudo /usr/local/share/python/easy_install pip | |
sudo pip install virtualenv virtualenvwrapper | |
} | |
function install_ipython { | |
pip install ipython | |
export PYTHONPATH=/usr/local/lib/python2.7:$PYTHONPATH | |
brew install zmq | |
sudo pip install pyzmq | |
} | |
install_python | |
config_python | |
install_pip_virtualenv | |
install_ipython |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment