Skip to content

Instantly share code, notes, and snippets.

@webinista
Last active April 23, 2021 07:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save webinista/b4b6a4cf8f158431b2c5134630c2cbfe to your computer and use it in GitHub Desktop.
Save webinista/b4b6a4cf8f158431b2c5134630c2cbfe to your computer and use it in GitHub Desktop.
PycURL error: 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.

Partly pulled from the comments here: pycurl/pycurl#526

May also be a fix for this error:

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

If you try to install PycURL and receive this error:

 Curl is configured to use SSL, but we have not been able to determine which SSL backend it is using

Here's one way to fix. First, the pre-requisites:

  • Install Xcode command line tools with xcode-select --install if they aren't already.
  • Install Homebrew if you don't have it already: https://brew.sh/
  • Uninstall your current version of cURL if you have one installed.
  • Uninstall your current version of PycURL.

Then do the following:

  1. Use brew install curl --with-openssl to install cURL
  2. Run export PYCURL_SSL_LIBRARY=openssl to set the library for PycURL
  3. Run the following commmand (really 3 commands in 1) to tell the compiler where to find openssl, then download and compile pycurl with pip.
export LDFLAGS=-L/usr/local/opt/openssl/lib;export CPPFLAGS=-I/usr/local/opt/openssl/include; pip install pycurl --compile --no-cache-dir
@yacitus
Copy link

yacitus commented Jan 18, 2019

This worked! Thank you!

Note I had to run pip uninstall pycurl first.

@AnaMakarevich
Copy link

Is there a way to fix that when it's happening inside the virtual environment. I tried most of the solutions found on StackOverflow, but I'm still getting:

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

@diofeher
Copy link

diofeher commented Apr 4, 2019

I'm having the same error
ImportError: pycurl: libcurl link-time ssl backend (none/other) is different from compile-time ssl backend (openssl)

@davidsbailey
Copy link

I had the same error in a virtualenv:

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

The following fixed it for me:

unset PYCURL_SSL_LIBRARY
pip uninstall pycurl
pip install --no-cache-dir --compile pycurl

Part of the problem is that I had gotten into a bad state by following these instructions, but those are for solving the opposite problem : ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (none/other)

@Allen-Liang
Copy link

unset PYCURL_SSL_LIBRARY
pip uninstall pycurl
pip install --no-cache-dir --compile pycurl

got it.yes

@arossert
Copy link

@Allen-Liang Did you figure it out? I have the same issue using Python2, it is working in Python3.
It worked to me until yesterday when I execute brew upgrade and all my libs (curl & openssl) have been updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment