linux(centos8)如何安装python3.9?在安装python时或者在用到python的时候,会依赖一些环境。为了防止在安装时出现问题,请确保机器上有一下包。今天,云服务器网(04cloud.com)小编就介绍一下linux系统是如何安装python环境的,实际演示版本为: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/
或者直接下载:https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz
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