一捧阳光 > CentOS安装Python3.10最新版

热爱代码,对每一行代码保持一颗敬畏之心。

已亲测基于CentOS Linux release 7.9.2009 (Core)安装正常。

安装依赖

yum -y groupinstall "Development tools"
yum install -y ncurses-devel gdbm-devel xz-devel sqlite-devel tk-devel uuid-devel readline-devel bzip2-devel libffi-devel
yum install -y openssl-devel openssl11 openssl11-devel

安装

下载源码包,解压并编译安装:

wget https://www.python.org/ftp/python/3.10.7/Python-3.10.7.tar.xz
tar -xf Python-3.10.7.tar.xz
cd Python-3.10.7/
./configure --enable-optimizations && make altinstall

配置软件方便命令输入

ln -sf /usr/local/bin/python3.10 /usr/bin/python3
ln -sf /usr/local/bin/pip3.10  /usr/bin/pip3

验证

验证Python及pip版本

python3 -V
pip3 --version

完毕。

tagged by none