zoukankan      html  css  js  c++  java
  • Centos 6.5 python 2.6.6 升级到 2.7

    1、查看python的版本

    [root@localhost ~]# python -V
    Python 2.6.6

    2、安装python 2.7.3

        [root@localhost ~]# yum install -y gcc-c++

        [root@localhost ~]# wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.b

        [root@localhost ~]# tar -jxvf Python-2.7.3.tar.bz2

        [root@localhost ~]# cd Python-2.7.3

        [root@localhost Python-2.7.3]# ./configure

        [root@localhost Python-2.7.3]# make all

        [root@localhost Python-2.7.3]# make install

        [root@localhost Python-2.7.3]# make clean

      [root@localhost Python-2.7.3]# make distclean

    3.查看版本信息  

    [root@localhost ~]# /usr/local/bin/python2.7 -V 
    Python 2.7.3

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

    [root@localhost ~]# mv /usr/bin/python /usr/bin/python2.6.6 
    [root@localhost ~]# ln -s /usr/local/bin/python2.7 /usr/bin/python

    5、重新检验Python 版本 

    [root@localhost ~]# python -V
    Python 2.7.3

      

    6、解决系统 Python 软链接指向 Python2.7 版本后,因为yum是不兼容 Python 2.7的,所以yum不能正常工作,我们需要指定 yum 的Python版本 

       [root@localhost ~]# vi /ust/bin/yum

        将文件头部的 #!/usr/bin/python 

        改成 #!/usr/bin/python2.6.6

  • 相关阅读:
    poj 3669 Meteor Shower
    poj 3009 Curling 2.0
    poj 1979 Red and Black
    区间内素数的筛选
    九度oj 题目1347:孤岛连通工程
    poj 3723 Conscription
    poj 3255 Roadblocks
    Luogu P3975 [TJOI2015]弦论
    AT2165 Median Pyramid Hard 二分答案 脑洞题
    后缀自动机多图详解(代码实现)
  • 原文地址:https://www.cnblogs.com/yezl/p/6697965.html
Copyright © 2011-2022 走看看