Skip to content

Instantly share code, notes, and snippets.

@nfarring
Created July 12, 2011 20:32
Show Gist options
  • Save nfarring/1078911 to your computer and use it in GitHub Desktop.
Save nfarring/1078911 to your computer and use it in GitHub Desktop.
Script to install lastest version of Python on a Ubuntu/Debian system.
# Make sure we have the basics.
sudo apt-get install build-essential
# Install the build dependencies for Python.
# Replace with python2.7 if your distro supports it.
sudo apt-get build-dep python2.6 python-gdbm python-bsddb3
# Use pythonbrew to actually compile Python.
curl -kL http://xrl.us/pythonbrewinstall | bash
pythonbrew install 2.7.2
pythonbrew switch 2.7.2
pip install virtualenv
pip install virtualenvwrapper
# The next step is to configure virtualenvwrapper. Add this to your .bashrc:
if [[ -e $(\which virtualenvwrapper.sh) ]]; then
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENV_USE_DISTRIBUTE=1
export PIP_VIRTUALENV_BASE=$WORKON_HOME
export PIP_RESPECT_VIRTUALENV=true
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
source $(\which virtualenvwrapper.sh)
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment