发布时间:2019-09-16 07:35:53编辑:auto阅读(1576)
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
47841
46390
37281
34733
29312
25973
24914
19950
19544
18030
5791°
6413°
5927°
5961°
7064°
5911°
5943°
6437°
6404°
7778°