CentOS7 下安装 Python3.8.5
一、前置条件
1)安装依赖
1 | yum -y install libffi-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make |
2)更新 openssl
1 | wget --no-check-certificate https://www.openssl.org/source/openssl-1.1.1t.tar.gz |
二、下载解压
1 | wget https://mirrors.huaweicloud.com/python/3.8.5/Python-3.8.5.tgz |
三、编译安装
1 | cd Python-3.8.5 |
四、配置环境变量并创建软连接
1 | # vim /etc/profile |
五、配置清华源
1 | pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple |
六、测试
1 | # 查看 python 版本 |