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