centos7 安装 python3.7.5

1.查看当前Python版本

[root@centos software]# python -V
Python 2.7.5

2.wget下载安装文件

[root@centos software]# wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz

3.解压安装包

[root@centos software]# tar -zxvf Python-3.7.5.tgz 

4.进入Python-3.7.5文件夹

[root@centos software]# cd Python-3.7.5

5.创建目录

[root@centos Python-3.7.5]# mkdir /usr/local/python3.7.5

6.执行配置

[root@centos Python-3.7.5]#   ./configure -prefix=/usr/local/python3.7.5

7.安装

[root@centos Python-3.7.5]#   make && make install

8.创建软连接

[root@centos Python-3.7.5]#   ln -s /usr/local/python3.7.5/bin/python3.7 /usr/bin/python3
[root@centos Python-3.7.5]#   ln -s /usr/local/python3.7.5/bin/pip3 /usr/bin/pip3

9.验证版本

[root@centos Python-3.7.5]#  python3 -V
Python 3.7.5

 

你可能感兴趣的:(我的python学习)