centos6 python2.6.6升python2.7.15

1,下载源代码

wget https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz

2,解压

tar -zxvf Python-2.7.12.tgz

3,切换目录

cd Python-2.7.15

4,编译安装

1
2
3
4
5
./configure
make all
make install
make clean
make distclean

5,使系统默认指向python2.7

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

6,yum是不兼容 Python 2.7的 解决办法

1
2
3
4
5
#vi /usr/bin/yum
将文件头部的
#!/usr/bin/python
改成
#!/usr/bin/python2.6.6

One Reply to “centos6 python2.6.6升python2.7.15”

  • 附加2.7.14编译选项
    /configure –prefix=/usr/local/python2.7.14 –enable-shared–enable-profiling –disable-ipv6 –with-signal-module –with-dec-threads–with-threads –with-pth –with-doc-strings –with-tsc –with-pymalloc–with-wctype-functions –with-fpectl | tee /tmp/python2.7.14.out

发表评论

电子邮件地址不会被公开。 必填项已用*标注

*