MacOS 用 pyenv 安装 Python 遇到 The Python ssl extension was not compiled 的解决方案

3,758 阅读1分钟

完整错误信息如下:

ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

卸载 openssl:

brew uninstall --ignore-dependencies openssl

再重新用 pyenv 安装 Python:

pyenv install 2.7.9

此时 pyenv 会自动下载并编译一份 openssl,等待安装完成即可