Centos 7.6 Install Python 3.7.3

依赖

yum install wget db4-devel libpcap-devel xz-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel gcc gcc-c++ make openldap-devel mysql-devel zip unzip libffi-devel -y

下载Python

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

解压Python

tar -zxvf Python-3.7.3.tgz

编译安装Python

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

添加Python软链到执行目录下/usr/local/bin/

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

版本查询

python3 -V
pip3 -V

 

你可能感兴趣的:(Python)