简体   繁体   English

Python无法在Mac中使用pyenv安装

[英]Python can't install with pyenv in mac

$ brew install pyenv-virtualenv

and append the following to .bash_profile. 并将以下内容附加到.bash_profile。

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

$ source ~/.bash_profile

and install python. 并安装python。

$ pyenv install 2.7.11

Then the error occured. 然后发生错误。

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

How to solve? 怎么解决?

您所要做的就是遵循命令。

$ xcode-select --install

Tried above solution but found this in my google research fixing my issue installing Python 3.6.7 with pyenv https://github.com/pyenv/pyenv/issues/1219 尝试了上述解决方案,但在我的Google研究中发现了这个问题,修复了使用pyenv安装Python 3.6.7的问题https://github.com/pyenv/pyenv/issues/1219

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

Hopes that helps! 希望能有所帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM