转载 https://www.cnblogs.com/king8/p/9216133.html
注:原有linux带2. python不用卸载
1、依赖包安装
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel
这步是必须安装,要不后面pip会报错
2、下载包:可以手工从网站下载,之后ftp工具上传
https://www.python.org/ftp/python/3.8.0/
wget https://www.python.org/ftp/python/3.8.3/Python-3.8.3.tgz
3、解压
tar -zxvf 文件名
安装路径 /usr/local/python3/Python-3.8.11
4、安装
cd Python-3.8.0 ./configure --prefix=/usr/local/python3 make && make install
python3.8安装成功图
5、建立软链接
ln -s /usr/local/python3/bin/python3.8 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3.8 /usr/bin/pip3
6、查看安装是否成功
验证成功 python3和pip3
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
![](https://img2020.cnblogs.com/blog/1615113/202107/1615113-20210723165334863-1999210094.png)
https://www.jianshu.com/p/8e476eef43f7