20

When I perform pip install thumbor I get the following error:

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.

I've tried brew install curl (which was successfull) however I get the same error when I perform pip install thumbor.

Any idea why?

Zorgan
  • 8,227
  • 23
  • 106
  • 207
  • Possible duplicate of [SSL backend error when using OpenSSL](https://stackoverflow.com/questions/21096436/ssl-backend-error-when-using-openssl) – phd Jun 25 '18 at 10:32
  • I don't think it is a duplicate as most of the answers there involve doing a reinstall, which has fixed it for me in the past. This is an error that also comes up on first installation of *pycurl*, so the usual solution of uninstalling then installing again is not applicable. – Nagev Aug 09 '18 at 14:34

3 Answers3

63

It seems like it's pycurl install error.

When installing on centos try this:

export PYCURL_SSL_LIBRARY=openssl

If you install on macos try this one:

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

then run pip install pycurl

gawi
  • 2,843
  • 4
  • 29
  • 44
LC.Zhang
  • 631
  • 4
  • 4
1

I was receiving this error when deploying to Beanstalk since I need pycurl for Celery. While in many discussions people recommend different ssl options, my solution was not to use any of these options. Python config file for deploying looks as follows:

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'

I did not set any environment variables within the software configuration of Beanstalk.

On MacOS Mojave this worked for me:

  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
Greg Holst
  • 874
  • 10
  • 23
0

I couldn't get past this error with Python 3.6 from Software Collections, so I installed Python 3.5 from the same repository.

Then I installed Pycurl with:

sudo yum install sclo-python35-python-pycurl

Which worked just fine. The reason I used 3.5 is because there wasn't a similar package for 3.6. So you might want to try finding Pycurl on your package manager for the version you're using and install it that way instead.

Nagev
  • 10,835
  • 4
  • 58
  • 69