I wanted to run python file. But I could check this error when I ran it.
ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (none/other)
My system is Mac os 10.13.2 and I used python 2.7
Looks like something went wrong with pycurl/openssl, try this:
pip uninstall pycurl
pip install --compile --install-option="--with-openssl" pycurl
if still fails, try this as well
brew reinstall openssl
For m1 users, it works for me
brew install curl-openssl
pip uninstall pycurl
PYCURL_SSL_LIBRARY=openssl \
LDFLAGS="-L$(brew --prefix openssl)/lib" \
CPPFLAGS="-I$(brew --prefix openssl)/include"
pip install --compile --install-option="--with-openssl" pycurl
This was done by my fellow mac users.
# pycurl
pip uninstall pycurl
export CPPFLAGS=-I/usr/local/opt/openssl/include # may be needed
export LDFLAGS=-L/usr/local/opt/openssl/lib # may be needed
pip install --no-cache-dir --compile --ignore-installed --install-option="--with-openssl" pycurl
I got this same issue in windows which had a different fix(perhaps this might fit Mac too). In my requirements.txt I had pycurl-7.43.0.4
but on the windows dowloader page I could only find 7.44.1
which I installed (pip install .\pycurl-7.44.1-cp37-cp37m-win_amd64.whl
). And then on starting my Django server python manage.py runserver
I got the error in question. And the solution was to bring the pycurl back to it's expected version. pip install pycurl==7.43.0.5
and it replaced the version as given below. And the error was gone!
Reinstall the curl libraries
brew install curl --with-openssl
Install pycurl with correct environment and paths
export PYCURL_SSL_LIBRARY=openssl
pip uninstall pycurl
pip install --no-cache-dir --global-option=build_ext --global-option="-L/usr/local/opt/openssl/lib" --global-option="-I/usr/local/opt/openssl/include" pycurl
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With