> 文章作者:指剑
### 安装必备包
```
sudo yum update -y
sudo yum groupinstall "Development Tools" -y
sudo yum erase openssl-devel -y
sudo yum install openssl11 openssl11-devel libffi-devel bzip2-devel wget -y
```
### 下载、解压 python
```
wget https://www.python.org/ftp/python/3.10.12/Python-3.10.12.tgz
tar -xf Python-3.10.12.tgz
```
### 编译安装 python3.10.x
**无 error 即为正常**
```
cd Python-3.10.12/
./configure --enable-optimizations
make -j \$(nproc)
make altinstall
```
![image.png](https://dev-media.amazoncloud.cn/919ec7ba89d2451fb46fa918280ed741_image.png "image.png")
![image.png](https://dev-media.amazoncloud.cn/b8385352d0db48f3b419ec94978906f5_image.png "image.png")
![image.png](https://dev-media.amazoncloud.cn/28eaad45afba4e79b7a706a07b11e3af_image.png "image.png")
### 更新符号链接
```
ln -sf /usr/local/bin/python3.10 /usr/bin/python3
```
### 印证
```
python3 --version
pip3 --version
```
![image.png](https://dev-media.amazoncloud.cn/e8f1f93271bd4350b9f898b9243cea01_image.png "image.png")
[![1.png](https://dev-media.amazoncloud.cn/125c6c8c26524e418a5570c2d3cd5750_1.png "1.png")](https://summit.amazoncloud.cn/2024/register.html?source=DSJAVfG2GS7gEk2Osm6kYXAa+8HnSEVdbCVjkuit7lE= )