发布时间:2019-09-16 07:35:53编辑:auto阅读(1714)
linux升级python到2.7
一、下载python2.7安装包
# wget https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz
二、解压
# tar -zxf Python-2.7.12.tgz # cd Python-2.7.12
三、新建安装目录,防止覆盖旧版本
# mkdir /usr/local/python27
四、安装
# cd Python-2.7.12 # ./configure --prefix=/usr/local/python27 # make && make install
五、旧版python改名
# mv /usr/bin/python /usr/bin/python24
六、创建链接到新版本
# ln -s /usr/local/python27/bin/python2.7 /usr/bin/python
七、测试
# python Python 2.7.12 (default, Sep 2 2016, 09:17:20) [GCC 4.1.2 20080704 (Red Hat 4.1.2-55)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
上一篇: Python中操作mysql知识(一)
下一篇: Python -- 关于pip安装Ipy
48925
48035
38800
35924
30344
27121
26125
20960
20784
19140
656°
737°
707°
705°
679°
640°
738°
824°
937°
1160°