在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:...