Upgrade to Python 2.7.9 on CentOS5.5

1. Install python2.7

#cd /tmp

#wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz --no-check-certificate

#tar zxvf Python-2.7.9.tgz

#cd Python-2.7.9

#./configure

#make

#make install

2. Setup python2.7 as default python

#cd /usr/bin

#mv python python.bak

#ln -s /usr/local/bin/python2.7 ./python

3. Define the old version python2.4 for yum

#vi /usr/bin/yum

#change “#!/usr/bin/python” to “#!/usr/bin/python2.4”

 

4. Install setuptools 15.2 (easy_install)

#wget https://pypi.python.org/packages/source/s/setuptools/setuptools-15.2.zip --no-check-certificate

#unzip setuptools-15.2.zip

#cd setuptools-15.2

#python setup.py install

5. Update system CAcert (for CentOS5.5 only)

#wget http://curl.haxx.se/ca/cacert.pem

#mv cacert.pem ca-bundle.crt

#mv ca-bundle.crt /etc/pki/tls/certs

6. Install & Update pip

#easy_install pip

#pip install --upgrade pip

#pip install --upgrade setuptools

#pip install requests

#pip install webapp2

 

你可能感兴趣的:(Upgrade to Python 2.7.9 on CentOS5.5)