CentOS 7.6 安装 Python3.7.3

下载

wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz

解压

tar -zxvf Python-3.7.3.tgz

安装依赖组件

yum -y  install openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel
yum -y  install libpcap-devel xz-devel gcc kernel-devel kenel-headers bzip2 bzip2-devel
yum -y install gcc-c++ zlib zlib-devel
yum -y install libffi-devel 

编译安装

cd Python-3.7.3
./configure --prefix=/usr/local/python3
make && make install

添加软连接

ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3  /usr/bin/pip3

你可能感兴趣的:(CentOS 7.6 安装 Python3.7.3)