SSL backend error when using OpenSSL SSL backend error when using OpenSSL python python

SSL backend error when using OpenSSL


for most people

After reading their INSTALLATION file, I was able to solve my problem by setting an environment variable and did a reinstall

# remove existing `pycurl` installation pip uninstall pycurl# export variable with your link-time ssl backend (which is openssl above)export PYCURL_SSL_LIBRARY=openssl# then, re-install `pycurl` with **no cache**pip install pycurl --no-cache-dir

There could be other solution out there but this works perfectly for me on a virtualenv and pip installation.

Some people have a different error message complaining about nss instead of openssl

ImportError: pycurl: libcurl link-time ssl backend (nss)

(the key part is nss) so you have to do something different for this error message:

pip uninstall pycurlpip install --no-cache-dir --compile --compile-options="--with-nss" pycurl


helloworld2013's answer is correct, but the key is matching the SSL library that pycurl is expecting. The error will be something like:

pycurl: libcurl link-time ssl backend (<library>) is different from compile-time ssl backend (<library> or "none/other")

To fix it, you have to use the library pycurl is expecting. In my case, my error was "pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (openssl)", so my fix was:

pip uninstall pycurlexport PYCURL_SSL_LIBRARY=nsspip install pycurl


With macOS 10.13, a brew-installed openSSL, and virtualenv, I was successful with:

# cd to your virtualenv, then…pip uninstall pycurlexport PYCURL_SSL_LIBRARY=opensslexport LDFLAGS=-L/usr/local/opt/openssl/libexport CPPFLAGS=-I/usr/local/opt/openssl/includepip install pycurl --compile --no-cache-dir