首页 > 代码库 > CentOS6默认的python2.6.6升级到python2.7.10

CentOS6默认的python2.6.6升级到python2.7.10

1.下载解压

wget http://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz

tar -zxvf Python-2.7.10.tgz

2.编译安装

cd Python-2.7.10

./configure --prefix=/usr/local/python2.7

make

make install

3.添加软连接和修改yum

mv /usr/bin/python /usr/bin/python2.6.6

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

vi /usr/bin/yum

#!/usr/bin/python 修改为 #!/usr/bin/python2.6.6

wq


CentOS6默认的python2.6.6升级到python2.7.10