【问题标题】:pycurl macOS Install issuepycurl macOS 安装问题
【发布时间】:2018-11-26 14:16:41
【问题描述】:

我需要安装 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.

有什么建议吗?

【问题讨论】:

标签: macos installation pycurl


【解决方案1】:

为了让 PycURL 在 macOS 上找到 OpenSSL 标头,我们需要指定要使用的 SSL 后端以及可以找到 OpenSSL 的位置:

pip install --install-option="--with-openssl" --install-option="--openssl-dir=/usr/local/opt/openssl" pycurl

【讨论】:

    【解决方案2】:

    最新版本的 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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-05-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-01
      • 1970-01-01
      相关资源
      最近更新 更多