centos系统下怎样在原有的python2.6版本下安装python2.7版本

2025-01-02 04:08:10
推荐回答(2个)
回答1:

cd /usr/local/src
wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz
tar zxvf Python-2.7.6.tgz
cd Python-2.7.6
./configure
make & make install

mv /usr/bin/python /usr/bin/python2.6.6
ln -s /usr/local/bin/python2.7 /usr/bin/python
python -V

sed -i 's/bin\/python/bin\/python2.6.6/' /usr/bin/yum

回答2:

基本没什么大问题,改动很小,升级到3.0的时候才会有一些麻烦