Skip to content

Instantly share code, notes, and snippets.

@kroger
Created February 13, 2012 23:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kroger/1821425 to your computer and use it in GitHub Desktop.
Save kroger/1821425 to your computer and use it in GitHub Desktop.
Install Python 2.7 on Mac OS
#!/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