gpt4 book ai didi

pycurl - 在 mac 更新到 High Sierra 后安装 Pycurl - SSL 错误

转载 作者:行者123 更新时间:2023-12-01 14:00:46 25 4
gpt4 key购买 nike

我将我的 mac 更新到 high sierra,现在我无法安装 pycurl。它失败并显示以下消息:Curl 已配置为使用 SSL,但我们无法确定它使用的是哪个 SSL 后端。请参阅 PycURL 文档以了解如何手动指定 SSL 后端。

我在文档和网络上进行了搜索,但发现了一些无法解决我的问题的解决方案。最受欢迎的是这个:

pip uninstall pycurl
export PYCURL_SSL_LIBRARY=openssl
pip install pycurl

这是完整的错误

enter image description here

最佳答案

一个解决方案类似于您在我的 virtualenv 中发布时发现的对我有用的解决方案。我使用 Homebrew 作为 macOS High Sierra 上的包管理器,使用 Pipenv 来管理我的项目依赖项和 virtualenv。将 PyVimeo API 库添加到我的项目后出现错误,该库具有 PycURL 作为依赖项。

首先,产生的错误是

src/pycurl.c:137:4: warning: #warning "libcurl was compiled with SSL support, but configure could not determine which library was used; thus no SSL crypto locking callbacks will be set, which may cause random crashes on SSL requests" [-Wcpp]

然后,

ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (none/other)

As mentioned in the PycURL docs ,解决方案是“告诉 [PycURL 的] setup.py 使用什么 SSL 后端。”单独设置 brew info openssl 输出中推荐的环境变量并不能解决问题。

然后我找到一个tangentially related Github issue comment并在我项目的 virtualenv 中尝试了以下操作:

(env)$ pip uninstall pycurl
(env)$ pip install --upgrade pip
(env)$ export LDFLAGS=-L/usr/local/opt/openssl/lib
(env)$ export CPPFLAGS=-I/usr/local/opt/openssl/include
(env)$ export PYCURL_SSL_LIBRARY=openssl
(env)$ pip install pycurl

install 命令给出了这个输出:

Collecting pycurl Using cached https://files.pythonhosted.org/packages/e8/e4/0dbb8735407189f00b33d84122b9be52c790c7c3b25286826f4e1bdb7bde/pycurl-7.43.0.2.tar.gz Building wheels for collected packages: pycurl Running setup.py bdist_wheel for pycurl ... done Stored in directory: /Users/me/Library/Caches/pip/wheels/d2/85/ae/ebf5ff0f1378a69d082b4863df492bf54c661bf6306a2bd Successfully built pycurl tuspy 0.2.1 has requirement pycurl==7.43.0, but you'll have pycurl 7.43.0.2 which is incompatible. Installing collected packages: pycurl Successfully installed pycurl-7.43.0.2

我注意到了(有点小?)tuspy 错误并继续前进。这一次,我的脚本在没有 PycURL 提示的情况下运行。

关于pycurl - 在 mac 更新到 High Sierra 后安装 Pycurl - SSL 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51075738/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com