我需要安装pycurl才能运行python脚本,但我找不到在macOS上运行pycurl的方法。
我已经尝试过brew,更新Pip,但是我总是在"pip install pycurl“之后收到这个错误。
Collecting pycurl
Using cached https://files.pythonhosted.org/packages/e8/e4/0dbb8735407189f00b33d84122b9be52c790c7c3b25286826f4e1bdb7bde/pycurl-7.43.0.2.tar.gz
Complete output from command python setup.py egg_info:
Using curl-config (libcurl 7.54.0)
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/vk/f193293d0pvd2ynlcpnyx9100000gn/T/pip-install-rxidIQ/pycurl/setup.py", line 913, in <module>
ext = get_extension(sys.argv, split_extension_source=split_extension_source)
File "/private/var/folders/vk/f193293d0pvd2ynlcpnyx9100000gn/T/pip-install-rxidIQ/pycurl/setup.py", line 582, in get_extension
ext_config = ExtensionConfiguration(argv)
File "/private/var/folders/vk/f193293d0pvd2ynlcpnyx9100000gn/T/pip-install-rxidIQ/pycurl/setup.py", line 99, in __init__
self.configure()
File "/private/var/folders/vk/f193293d0pvd2ynlcpnyx9100000gn/T/pip-install-rxidIQ/pycurl/setup.py", line 316, in configure_unix
specify the SSL backend manually.''')
__main__.ConfigurationError: Curl is configured to use SSL, but we have not been able to determine which SSL backend it is using. Please see PycURL documentation for how to specify the SSL backend manually.有什么建议吗?
发布于 2019-05-16 20:45:25
curl的最新版本支持多个ssl后端,并且pycurl无法决定在安装期间使用哪个后端。这是7.43.0.2中的已知问题(https://github.com/pycurl/pycurl/issues/530)。很多人建议安装curl时支持openssl,但在macos上最好使用默认的SecureTransport,让系统访问密钥链,而不是使用openssl中捆绑的证书。
尝试安装7.43.0.1来解决问题。
pip install pycurl==7.43.0.1如果这不起作用,请执行以下命令:
brew link curl
export LDFLAGS="-L/usr/local/opt/curl/lib"
export CPPFLAGS="-I/usr/local/opt/curl/include"然后重试
pip install pycurl==7.43.0.1发布于 2021-10-11 20:11:35
为了让PycURL在macOS上找到OpenSSL头,我们需要指定要使用的macOS后端以及可以找到OpenSSL的位置:
pip install --install-option="--with-openssl" --install-option="--openssl-dir=/usr/local/opt/openssl" pycurlhttps://stackoverflow.com/questions/50897528
复制相似问题