Centos8 安装Python3.9源码

Centos8 安装Python3.9源码
1 、首先升级:

yum install -y update

2、再安装 gcc和make插件:

yum install gcc gcc-c++
yum -y install gcc automake autoconf libtool make
yum groupinstall -y 'Development Tools'
yum install -y gcc openssl-devel bzip2-devel libffi-devel
yum install zlib zlib-devel openssl

3、下载python
https://www.python.org/downloads/release/python-392/
4、上传服务器

cd /home
mkdir tools
cd tools

5、解压

tar -xzvf pytonxxx

6、编译安装python

cd pythonXXX
./configure prefix=/usr/local/python3 --enable-optimizations
make && make install

7、环境变量修改

export PATH=$PATH:/usr/local/python3/bin/

8、验证

pip3 list
python3 -v

你可能感兴趣的:(Linux相关,python,centos,编译,开源)