Skip to content

Instantly share code, notes, and snippets.

@lambdalisue
Created September 22, 2011 03:49
Show Gist options
  • Save lambdalisue/1233979 to your computer and use it in GitHub Desktop.
Save lambdalisue/1233979 to your computer and use it in GitHub Desktop.
Environmental Construction Collection
#!/bin/bash
PLATFORM=`uname`
PYTHON_VERSION=2.7.2
echo "*****************************************************"
echo
echo " Install and Config pythonbrew"
echo
echo "*****************************************************"
if [ "$PLATFORM" = 'Linux' ]; then
echo "Installing required packages to install pythonbrew..."
sudo apt-get -qq -y install curl build-essential python-all-dev python3-all-dev
sudo apt-get -qq -y install libreadline6-dev libsqlite3-dev libgdbm-dev
sudo apt-get -qq -y install libbz2-dev libxml2-dev libxslt1-dev
fi
echo "Installing pythonbrw..."
curl -kL http://xrl.us/pythonbrewinstall | bash
source $HOME/.pythonbrew/etc/bashrc
echo "Do you want to add the following line to .profile on your home directory?"
echo
echo " [[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc"
echo
echo "[y/n]>"
read INPUT
if [ "$INPUT" = "y" ]; then
echo "[[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc" >> $HOME/.profile
echo "The line above has added on .profile of your home directory."
fi
echo "Installing python $PYTHON_VERSION with --enable-unicode=ucs4 options. It may take a minutes."
pythonbrew install --no-test --configure="--enable-unicode=ucs4" $PYTHON_VERSION
pythonbrew switch $PYTHON_VERSION
pythonbrew venv init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment