系统状态
- CentOS Linux release 7.5.1804 (Core) mini版安装系统
- Python-3.7.0.tgz 官方下载源码包
安装系统依赖包
# 编译必备
yum install gcc
yum install zlib-devel
yum install openssl-devel
yum install libffi-devel
开始安装python
tar xzfv Python-3.7.0.tgz
cd Python-3.7.0
./configure --enable-optimizations --enable-loadable-sqlite-extensions --enable-ipv6 --prefix=/usr/local/python3.7
make
make install
配置系统环境变量
echo 'export PATH="/usr/local/python3.7/bin:$PATH"' >> /etc/profile
source /etc/profile
整个python到这就安装完成了。