Python2.7替换2.6:

1.下载Python-2.7.3

#wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2

2.解压

#tar -jxvf Python-2.7.3.tar.bz2

3.更改工作目录

#cd Python-2.7.3

4.安装

#./configure

#make all         

#make install

#make clean

#make distclean

5.查看版本信息

#/usr/local/bin/python2.7 -V

6.建立软连接,使系统默认的 python指向 python2.7

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

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

7.重新检验Python 版本

#python -V

 

Python2.7替换2.6后yum使用:

由于yum没有兼容python2.7,需要

vi /usr/bin/yum

将 #!/usr/bin/python 修改为 #!/usr/bin/python2.6

相关文章:

  • 2021-05-21
  • 2021-06-07
  • 2022-01-29
  • 2022-12-23
  • 2021-07-08
  • 2022-02-11
  • 2022-02-17
  • 2022-12-23
猜你喜欢
  • 2021-09-07
  • 2021-10-31
  • 2021-05-14
  • 2022-01-24
  • 2022-12-23
  • 2022-12-23
  • 2022-02-17
相关资源
相似解决方案