CentOS编译安装Python

环境查看

# cat /etc/redhat-release 
CentOS Linux release 7.9.2009 (Core)
# uname -a
Linux docker 3.10.0-1160.102.1.el7.x86_64 #1 SMP Tue Oct 17 15:42:21 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

下载源码包

下载地址:https://www.python.org/downloads/source/
image

编译安装

# 安装依赖
yum -y install gcc-c++
# 解压
tar -xf Python-3.11.6.tgz 
# 编译安装
./configure && make && make install

查看版本

# python3 --version
Python 3.11.5
posted @ 2023-11-08 16:32  minseo  阅读(52)  评论(0编辑  收藏  举报