在配备 Apple M1 芯片的计算机上安装
pycurl
一直很困难。我一直在使用此命令使用 pycurl
安装 pip
和 OpenSSLv3:
brew update && brew install openssl
export LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include"
pip uninstall pycurl
pip install --compile --install-option="--with-openssl" pycurl
但是在 pip v23.1+ 中(参见此处),
--install-option
已被删除,我不知道如何创建等效的命令。
删除
--install-option
的原因是安装软件包的 setup.py install
模式已被弃用并随后被删除。因此,无法告诉 pip 将某些内容传递给 setup.py
,因为它不再被调用,另请参阅 here。
我建议你下载pycurl源码然后手动调用
python setup.py --with-openssl install
pip install --no-cache-dir --compile --ignore-installed --config-setting="--build-option=--with-openssl" pycurl