Pythonbrew is now deprecated. So we should use pyenv then.
pyenv is inspired by rbenv and ruby-build, and is pretty handy.
cd ~
git clone https://github.com/yyuu/pyenv .pyenv
echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
reload your shell, and all set.
pyenv install 2.7.5
pyenv install 3.2.5
pyenv shell 2.7.5
pyenv shell system
pyenv local 2.7.5
it writes a file named .python-version
with content 2.7.5
.
pyenv global 2.7.5
it writes a file named ~/.pyenv/version
with content 2.7.5
.
mkdir -p "$(pyenv root)/cache"