1.编译环境
dnf groupinstall 'development tools'
dnf install bzip2-devel expat-devel gdbm-devel ncurses-devel openssl-devel readline-devel sqlite-devel tk-devel xz-devel zlib-devel wget
dnf install libffi-devel -y
2.下载python3.9.4
mkdir download
cd download
wget https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tgz
- 编译&安装
tar -zxvf Python-3.9.4.tgz
cd Python-3.9.4
./configure --enable-optimizations
make && make install
4、建立软连接
ln -s /usr/local/bin/python3.9 /usr/bin/python3
ln -s /usr/local/bin/pip3.9 /usr/bin/pip3
- 完成
参考:1. https://blog.csdn.net/Test_Sir_Cao/article/details/107356218