zipimport.ZipImportError: can't decompress data; zlib not available

macOS Mojave使用pyenv安装Python 3.7.2报错:

zipimport.ZipImportError: can't decompress data; zlib not available

解决方法:

sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /