根据 Medium 上这篇文章的分享,用下面的指令可以安装成功。
https://medium.com/@pimterry/setting-up-pyenv-on-os-x-with-homebrew-56c7541fd331
CFLAGS="-I$(brew --prefix readline)/include -I$(brew --prefix openssl)/include -I$(xcrun --show-sdk-path)/usr/include" \
LDFLAGS="-L$(brew --prefix readline)/lib -L$(brew --prefix openssl)/lib" \
PYTHON_CONFIGURE_OPTS=--enable-unicode=ucs2 \
pyenv install 3.6.8
1
littlewey 2019-06-11 08:06:24 +08:00 via iPhone 1
我当时刚好也遇到了,用了另一个方法。我记得我也搜到这个方法,但是在我那里不好用。
xcode-select --install sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target / 参考 https://github.com/pyenv/pyenv/issues/1219 写的笔记记录在这: https://note.siwei.info/jupyter-notes/ |
2
ysicing 2019-06-11 08:39:07 +08:00
我也遇到了这个问题,重装了 zlib
brew install zlib cat >> ~/.zshrc <<EOF # For compilers to find zlib you may need to set: export LDFLAGS="${LDFLAGS} -L/usr/local/opt/zlib/lib" export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/zlib/include" # For pkg-config to find zlib you may need to set: export PKG_CONFIG_PATH="${PKG_CONFIG_PATH} /usr/local/opt/zlib/lib/pkgconfig" EOF source ~/.zshrc |
3
819916913 2019-06-11 10:30:19 +08:00
好奇 macOS_SDK_headers_for_macOS_10.14 这个是什么东西,上次装完这个,重启系统就挂了,格式化磁盘重装系统才行。。。
|
4
mckelvin 2019-06-11 15:52:43 +08:00
更通用的办法时 pyenv install 前按 `brew info zlib` 的提示设置下几个变量
``` $ brew info zlib | grep expor export LDFLAGS="-L/usr/local/opt/zlib/lib" export CPPFLAGS="-I/usr/local/opt/zlib/include" export PKG_CONFIG_PATH="/usr/local/opt/zlib/lib/pkgconfig" ``` |