CentOS7安装Python3.6
解压缩Python3.6.tgz(官网下载)
tar zxvf Python-3.6.0.tgz
新建一个目录用于存放安装的Python3.6
cd Python-3.6.0
mkdir /usr/local/python36
配置安装路径
./configure --prefix=/usr/local/python36
编译Python3.6
make
编译安装
make install
报错情况1的解决办法
zipimport.ZipImportError: can’t decompress data; zlib not available
执行:yum -y install zlib*
重新编译安装
make
make install
看到下面这句说明安装成功了
Successfully installed pip-9.0.1 setuptools-28.8.0
设置Python3.6的软链
ln -s /usr/local/python36/bin/python3 /usr/bin/python36