最近升级 Mac 系统,又手贱升级了 pyenv,结果安装 Python3.7 时报了错

1
pyenv install 3.7 zipimport.ZipImportError: can't decompress data; zlib not available

查询了下,发现是因为 Xcode 命令行工具没有安装需要的头,需要手动进行安装,运行如下命令可以解决这个问题

1
2
$ xcode-select --install
$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

我的环境是

03-16 15:26