SSL backend error when using OpenSSL

helloworld2013 picture helloworld2013 · Jan 13, 2014 · Viewed 58.4k times · Source

I was trying to install pycurl in a virtualenv using pip and I got this error

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

I read some documentation saying that "To fix this, you need to tell setup.py what SSL backend is used" (source) although I am not sure how to do this since I installed pycurl using pip.

How can I specify the SSL backend when installing pycurl with pip?

Thanks

Answer

helloworld2013 picture helloworld2013 · Jan 13, 2014

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.