升级python2升级到python3_python2.x升级到python3.7

Python的3.0版本,常被称为Python 3000,或简称Py3k。相对于Python的早期版本,这是一个较大的升级。为了不带入过多的累赘,Python 3.0在设计的时候没有考虑向下兼容。

一、下载python3并解压

wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz && tar -zxvf Python-3.7.0.tgz && cd Python-3.7.0

二、安装所需依赖包

yum -y install gcc zlib* openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel libffi-devel

三、配置安装路径

./configure --prefix=/usr/local/python3

四、编译安装

make && make install

五、更新环境

1.先查看下目前python的状况:

[root@linux Python-3.7.0]# ll /usr/bin/python*

lrwxrwxrwx 1 root root 7 Aug 9 12:32 /usr/bin/python -> python2

lrwxrwxrwx 1 root root 9 Aug 9 12:32 /usr/bin/python2 -> python2.7

-rwxr-xr-x 1 root root 7216 Jul 13 21:07 /usr/bin/python2.7

-rwxr-xr-x 1 root root 1835 Jul 13 21:07 /usr/bin/python2.7-config

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值