Centos7.9 配置Python3.8

一、安装依赖

yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make libffi-devel

二、下载安装包

wget https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tgz
#解压命令 tar -xzvf Python-3.8.12.tgz

三、编译安装

./configure --prefix=/home/python3   #指定安装路径
make && make install   #编译安装

四、 添加软连接

ln -s /home/python3/bin/python3.8 /usr/bin/python3
ln -s /home/python3/bin/pip3 /usr/bin/pip3

五、程序后台运行

nohup python  -u test.py > test.log 2>&1 &
ps aux |grep python

你可能感兴趣的:(Centos7.9 配置Python3.8)