Curl已配置为使用SSL,但我们无法确定它使用的SSL后端

时间:2018-06-25 08:55:51

标签: python ssl terminal pip

执行pip install thumbor时出现以下错误:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/var/folders/t9/***********************/T/pip-install-knrabyuy/pycurl/setup.py", line 913, in <module>
    ext = get_extension(sys.argv, split_extension_source=split_extension_source)
  File "/private/var/folders/t9/***********************/T/pip-install-knrabyuy/pycurl/setup.py", line 582, in get_extension
    ext_config = ExtensionConfiguration(argv)
  File "/private/var/folders/t9/***********************/T/pip-install-knrabyuy/pycurl/setup.py", line 99, in __init__
    self.configure()
  File "/private/var/folders/t9/***********************/T/pip-install-knrabyuy/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.

我尝试过brew install curl(成功),但是当我执行pip install thumbor时遇到相同的错误。

知道为什么吗?

3 个答案:

答案 0 :(得分:34)

似乎安装了pycurl错误。 如果在centos上安装,请尝试以下操作:export PYCURL_SSL_LIBRARY=openssl。 如果在macOS上安装,请尝试以下一种方法:

export PYCURL_SSL_LIBRARY=openssl
export LDFLAGS=-L/usr/local/opt/openssl/lib
export CPPFLAGS=-I/usr/local/opt/openssl/include

然后运行pip install pycurl

答案 1 :(得分:0)

我无法通过Software Collections中的Python 3.6克服此错误,因此我从同一存储库安装了Python 3.5

然后我用以下方法安装了Pycurl:

sudo yum install sclo-python35-python-pycurl

哪个工作正常。我使用3.5的原因是因为3.6没有类似的软件包。因此,您可能想尝试在软件包管理器中找到要使用的版本的Pycurl,然后以这种方式安装。

答案 2 :(得分:0)

部署到Beanstalk时收到此错误,因为我需要pycurl用于Celery。尽管在许多讨论中人们建议使用不同的ssl选项,但我的解决方案是不使用任何这些选项。用于部署的Python配置文件如下所示:

packages:
  yum:
    git: []
    postgresql93-devel: []
    libcurl-devel: []
    libjpeg-turbo-devel: []

commands:
  01_download_pip3:
      command: 'curl -O https://bootstrap.pypa.io/get-pip.py'
  02_install_pip3:
      command: 'python3 get-pip.py'
  03_pycurl_uninstall:
      command: '/usr/bin/yes | sudo /opt/python/run/venv/bin/pip3 uninstall pycurl'
  04_pycurl_reinstall:
      command: 'sudo /opt/python/run/venv/bin/pip3 install pycurl'

我没有在Beanstalk的软件配置中设置任何环境变量。

在MacOS Mojave上,这对我有用:

  export PYCURL_SSL_LIBRARY=openssl
  export LDFLAGS=-L/usr/local/opt/openssl/lib;export CPPFLAGS=-I/usr/local/opt/openssl/include;pip3 install pycurl --compile --no-cache-dir