Skip to content

Instantly share code, notes, and snippets.

@erictleung
Created November 17, 2015 02:15
Show Gist options
  • Save erictleung/47a701c8b3913f8c4d81 to your computer and use it in GitHub Desktop.
Save erictleung/47a701c8b3913f8c4d81 to your computer and use it in GitHub Desktop.
Download and compile Python from source (if user is not root)
#!/bin/bash
# Shell script to install Python
# Note: Change `wget` download file as necessary (also not validated, yet)
# https://my.bluehost.com/cgi/help/python-install
# download, unzip, and setup Python
mkdir ~/python
cd ~/python
wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
tar zxfv Python-2.7.2.tgz
find ~/python -type d | xargs chmod 0755
cd Python-2.7.2
# install Python
./configure --prefix=$HOME/python
make
make install
# add to .bashrc
# export PATH=$HOME/python/Python-2.7.2/:$PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment