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
This worked for me:
For python 2.7
For python 3.5 also install the next:
Download the latest pycurl-7.43.0.tar.gz (md5) Source from pypi https://pypi.python.org/pypi/pycurl/7.43.0#downloads and run the next command:
Also you can do it into python environment:
This link sums up the reason why the errors occur and gives a clear instruction to fix the problem.
https://cscheng.info/2018/01/26/installing-pycurl-on-macos-high-sierra.html
For me, the problem occurred when I upgraded to High-Sierra from El Captain.
I had this problem for days. Finally with the help of other answers here (mainly Alexander Tyapkov's) I got it working for AWS Elastic Beanstalk.
Manual install (connecting with SSH):
IMPORTANT: Please note that you have to make sure you are using the currect version of Python and PIP, otherwise you might be compiling it for Python 2.x and using v3.x.
Auto-install in Elastic Beanstalk:
I had this problem because I was trying to configure Celery 4 with Django 1.10 in Elastic Beanstalk. If that's your case, I wrote a full blog post about it.
I am running this on OS X and some of the above solutions weren't working. Similar to Edward Newell's comment the
PYCURL_SSL_LIBRARY
variable seemed to have been completely ignored.Further reading of the PycURL installation doc revealed the following:
Therefore, I had to force it to compile with:
pip install --compile pycurl
That works on a number of cases. However, I did run into a few systems that continued to ignore the variable so, similar to maharg101's answer, I resorted to the install options which through pip can be set like this:
pip install pycurl --global-option="--with-[ssl|gnutls|nss]"
where you select one of the three options inside the square brackets. Notice that the available option is
ssl
and notopenssl
. If you specify--with-openssl
you'll get an error. Also note that if you were messing around with thePYCURL_SSL_LIBRARY
variable and switching it to funky values to see what would happen this last command will definitely catch it and throw an error if the value is set but not valid.