Skip to content

Instantly share code, notes, and snippets.

@ravibhure
Last active December 16, 2015 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ravibhure/5501298 to your computer and use it in GitHub Desktop.
Save ravibhure/5501298 to your computer and use it in GitHub Desktop.
Install python 2.7.3 on CentOS
#!/bin/bash
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/
yum -y groupinstall "Development tools"
yum -y install zlib-devel
yum -y install bzip2-devel openssl-devel ncurses-devel sqlite-devel mysql-devel
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
if [ ! -f Python-2.7.3.tar.bz2 ] ;then
echo "Python-2.7.3.tar.bz2 not found"
exit 1
fi
tar xf Python-2.7.3.tar.bz2
cd Python-2.7.3
./configure --prefix=/usr/local/python2.7
make && make altinstall
/usr/local/python2.7/bin/python2.7 -V
ln -s /usr/local/python2.7/bin/python2.7 /usr/bin/python2.7
# set -o vi
wget --no-check-certificate http://pypi.python.org/packages/source/d/distribute/distribute-0.6.27.tar.gz
if [ ! -f distribute-0.6.27.tar.gz ] ;then
echo "distribute-0.6.27.tar.gz not found"
exit 1
fi
tar xf distribute-0.6.27.tar.gz
cd distribute-0.6.27
python2.7 setup.py install
if [ $? != 0 ] ; then
echo "distribute installation failed"
exit 1
fi
if [ -f /usr/local/python2.7/bin/easy_install-2.7 ] ;then
ln -s /usr/local/python2.7/bin/easy_install-2.7 /usr/bin/easy_install-2.7
else
echo "/usr/local/python2.7/bin/easy_install-2.7 not found"
exit 1
fi
/usr/local/python2.7/bin/easy_install-2.7 pip
/usr/local/python2.7/bin/easy_install-2.7 virtualenv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment