macos - pycurl macOS 安装问题
问题描述
我需要安装 pycurl 才能运行 python 脚本,但我找不到在 macOS 上执行此操作的方法。
我已经尝试过 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.
有什么建议吗?
解决方案
最新版本的 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
推荐阅读
- firebase - Firestore 递归集合备份
- python - 使用 Python Pandas 对齐输出数据
- vue.js - vuetify 配色方案是如何工作的?
- apache-flink - 集成测试 flink 作业
- python - 如何指定python模块的正确版本
- javascript - Angular:无法使用 ExcelJS 导出 excel-错误 TS2307:找不到模块“流”-错误 TS2503:找不到命名空间“NodeJS”
- javascript - 在 React/Redux 应用程序中,为什么我在子组件中的 props.property 在控制台日志中显示未定义
- python - 当特定单词是列内列表中的值时,如何将特定单词添加到新列
- python - 停止整个脚本的 Tkinter 取消按钮
- postgresql - 有什么方法可以将 client_encoding 永久设置为“UTF8”吗?