V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
314x
V2EX  ›  问与答

centos6.4如何升级python到最新的2.7?

  •  
  •   314x · 2013-09-02 09:10:08 +08:00 · 2338 次点击
    这是一个创建于 3910 天前的主题,其中的信息可能已经有所发展或是发生改变。
    怎么设置升级后系统默认的python为2.7,之前2.6下安装的那些python组件是不是要重装呢?
    4 条回复    1970-01-01 08:00:00 +08:00
    nodejx
        1
    nodejx  
       2013-09-02 09:27:43 +08:00
    试试pythonbrew吧。
    kumu
        2
    kumu  
       2013-09-02 10:19:07 +08:00   ❤️ 1
    升级流程如下:

    # wget http://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz
    # tar xf Python-2.7.5.tgz
    # cd Python-2.7.5
    # ./confgure && make && make install
    # ln -sf /usr/local/bin/python2.7 /usr/local/bin/python
    # python
    Python 2.7.5 (default, Aug 26 2013, 18:29:38)
    [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> quit()
    314x
        3
    314x  
    OP
       2013-09-02 12:23:41 +08:00
    @kumu

    # ln -sf /usr/local/bin/python2.7 /usr/local/bin/python
    这是更改环境变量吗?
    kumu
        4
    kumu  
       2013-09-02 18:26:01 +08:00
    @314x 软链接
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1112 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 23:06 · PVG 07:06 · LAX 16:06 · JFK 19:06
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.