【问题标题】:Trouble in installation pycurlpycurl安装问题
【发布时间】:2018-06-12 02:12:24
【问题描述】:

我在我的 Mac 上安装 pycurl 确实遇到了麻烦,花了几个小时试图解决它,但不幸的是我没有找到任何有用的解决方案。

当我执行时: pip install pycurl 或 pip3.6 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/7j/6928gb292nq4rscm2nwxbnfr0000gn/T/pip-install-yozxmkui/pycurl/setup.py", line 913, in <module>
        ext = get_extension(sys.argv, split_extension_source=split_extension_source)
      File "/private/var/folders/7j/6928gb292nq4rscm2nwxbnfr0000gn/T/pip-install-yozxmkui/pycurl/setup.py", line 582, in get_extension
        ext_config = ExtensionConfiguration(argv)
      File "/private/var/folders/7j/6928gb292nq4rscm2nwxbnfr0000gn/T/pip-install-yozxmkui/pycurl/setup.py", line 99, in __init__
        self.configure()
      File "/private/var/folders/7j/6928gb292nq4rscm2nwxbnfr0000gn/T/pip-install-yozxmkui/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.

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/7j/6928gb292nq4rscm2nwxbnfr0000gn/T/pip-install-yozxmkui/pycurl/

任何帮助将不胜感激。

【问题讨论】:

    标签: python macos pycurl


    【解决方案1】:

    之前的答案并没有完全为我解决。我必须先设置 LDFLAGS 和 CPPFLAGS 才能构建并正确安装。 brew install openssl 提到了这些环境变量以及它们应该设置的内容:

    导出 LDFLAGS=-L/usr/local/opt/openssl/lib

    导出 CPPFLAGS=-I/usr/local/opt/openssl/include

    pip install pycurl --with-openssl

    【讨论】:

      【解决方案2】:

      根据the official doc. of pycurl

      PycURL requires that the SSL library that it is built against is the same one libcurl, and therefore PycURL, uses at runtime. PycURL’s setup.py uses curl-config to attempt to figure out which SSL library libcurl was compiled against, however this does not always work.

      我不确定这是否是您遇到的问题。但也许您应该尝试使用--with-openssl 来指定要使用的 SSL 库。

      【讨论】:

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