问题描述
我最近从塞拉(Sierra)升级到莫哈韦(Mojave).之后,我尝试使用pyenv install 3.5.6
.这会在后台使用自制程序来尝试安装python,但zipimport.ZipImportError: can't decompress data; zlib not available
失败.升级之前,相同的命令起作用.
I recently upgraded from Sierra to Mojave. After that I tried to use pyenv install 3.5.6
. This uses homebrew in the background to try to install python, which fails with zipimport.ZipImportError: can't decompress data; zlib not available
. The same command worked before the upgrade.
此问题已被问过,通常接受的解决方案是使用以下命令安装xcode命令行工具:xcode-select --install
.
This question has been asked before and the generally accepted solution is to install xcode command line tools using this command: xcode-select --install
.
我同时安装了xcode 10和命令行工具,但zlib仍然不可用.
I have both xcode 10 and the command line tools installed but zlib is still unavailable.
我尝试使用自制软件安装zlib,但这也不起作用.
I tried installing zlib using homebrew but that didn't work either.
(顺便说一句,我也考虑过从二进制文件安装python,但Mac OS X没有v3.5.6二进制文件)
(Incidentally I also looked into installing python from a binary but there's no v3.5.6 binary for Mac OS X)
任何帮助表示赞赏.
推荐答案
https://github. com/pyenv/pyenv/issues/1219
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
这篇关于如何在Mac OS X Mojave(10.14)上安装zlib?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!