https://blog.csdn.net/Test_Sir_Cao/article/details/107356218
https://www.cnblogs.com/reaptem/p/13887231.html
centos 8 安装 python3.9
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、下载
mkdir download
cd download
wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0a6.tgz
3、编译&安装
tar -zxvf Python-3.9.0a6.tgz
cd Python-3.9.0a6
./configure --enable-optimizations
make && make altinstall
4、建立软连接
ln -s /usr/local/bin/python3.9 /usr/local/bin/python3
ln -s /usr/local/bin/pip3.9 /usr/local/bin/pip3
-----------------------------------------------------------------
CentOS8下升级Python3.6到3.9
-
1,官网下载Python3.9源码文件
wget source_code_url
-
2,解压文件
tar -zxvf Python3.9.x.tgz
-
3,安装必要的包 (
根据提示,有就不用安装了)dnf -y install gcc zlib* libffi-devel
-
4,进入解压目录,进行编译和安装(根据需要自定义目录)
cd python3.9_folder
./configure --prefix=/usr/local/bin/python3
make&&make install
-
5,删除原先的命令,并建立新的软连接
rm -rf /usr/bin/python3
ln -s /usr/local/bin/python3/bin/python3 /usr/bin/python3
-
6,检查并验证
python3 -V