1. 程式人生 > >centos7.5下編譯安裝python3.7.0

centos7.5下編譯安裝python3.7.0

安裝編譯工具和依賴庫

yum groupinstall "Development Tools"

yum -y install wget openssl-devel bzip2-devel expat-devel ncurses-devel gdbm-devel readline-devel sqlite-devel tk-devel libffi libffi-devel e2fsprogs-devel uuid-devel libuuid-devel tcl

下載
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz

解壓
tar -zxvf Python-3.7.0.tgz

配置
./configure --prefix=/usr/local/python3 --with-uuid=ossp --enable-optimizations

編譯安裝
make -j2
make install -j2

產生python3連結
ln -s /usr/local/python3/bin/python3.6 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3