在centos6.7经过源码安装python3.6.7报错:python
zipimport.ZipImportError: can't decompress data; zlib not available
从报错信息中,咱们能够看出系统已经安装了zlib软件包,之因此报错是由于在编译安装时找不到zlib的开发连接库。centos
centos系统中,zlib的开发连接库软件包是“zlib-devel”,所以咱们只须要经过yum安装上该软件包便可:app
sudo yum -y install zlib-devel
安装后,从新执行 make&make install 便可正常安装上python3.6.7.spa
为方便执行python3,须要把命令加入环境变量PATH:code
[root@happiness ~]# echo "export PATH=/usr/local/python3/bin:$PATH" /etc/profile.d/python3.sh (/usr/local/python3,安装python3.6.7的自定义路径)
[root@happiness ~]# source /etc/profile.d/python3.sh
[root@happiness ~]# echo $PATH
/usr/local/python3/bin:...