无法连接到 HTTPS URL,因为 SSL 模块在 Mac/OS 上不可用

Can't connect to HTTPS URL because the SSL module is not available on Mac/OS

正在尝试构建 Python 2.7.17,然后在 Mac OS 10.14

上安装 pip

使用 brew 安装了 OpenSSL

Python 的构建无法构建 _ssl。当我尝试构建 pip 时,它失败并显示错误“无法连接到 HTTPS URL 因为 SSL 模块不可用

OpenSSL 已正确安装在 /usr/local/Cellar/openssl@1.1/1.1.1d/

Python 在 /usr/local/ssl

寻找 ssl

为了构建它,我执行了以下操作: 1. 建立一条不涉及任何奇怪字符的OpenSSL路径:

cd /usr/local/Cellar/
ln -s openssl\@1.1 openssl

2: 运行 ./configure

3:编辑 Makefile 将所有“/usr/local/ssl”替换为“/usr/local/Cellar/openssl”

4:运行制作/制作测试/制作安装

这创建了一个具有 _ssl 的 Python,因此 pip 将 运行