CentOS 编译安装python2.7

安装过程

yum groupinstall "Development tools"
yum install zlib-devel libxml2-devel libxslt-devel openssl openssl-devel sqlite-devel readline-devel
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar xf Python-2.7.3.tgz
cd Python-2.7.3
./configure --prefix=/usr/local
make && make altinstall

多个版本的python共存,建议使用virtualenv来管理项目,指定使用哪个版本的python