3

My system is macOS 10.13.1 I was try import pycurl is error

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

I tried these two methods

sudo pip uninstall pycurl
export PYCURL_SSL_LIBRARY=openssl
sudo pip install pycurl

or

sudo pip uninstall pycurl
sudo pip install --compile --install-option="--with-openssl" pycurl

Ive tried multiple variations of this, but none of them seem to work. Any ideas?

jww
  • 97,681
  • 90
  • 411
  • 885
jianyi
  • 151
  • 1
  • 3
  • 11
  • Possible duplicate of [this](https://stackoverflow.com/questions/21096436/ssl-backend-error-when-using-openssl) SO question. – Jeroen Heier Jan 06 '18 at 07:31
  • I tried other answers to the same questions. But no use. Please help or try to give some ideas how to achieve this – jianyi Jan 06 '18 at 07:44
  • 1
    If you're looking for general advice on the subject, I will recommend what I do. I try very hard not to install anything directly on osx if I don't have to. Instead I use docker which allows me to describe my runtime environment and dependencies in a reproducible and isolated manner. I'll guarantee you that if you do it right you'll never see errors like this and things will get a lot simpler to install, for your peers and well as you. – erik258 Jan 06 '18 at 17:35
  • Thank you for your answer but I still want to know how to solve this problem and I haven't used docker and I don't know how to use it with pycharm. – jianyi Jan 09 '18 at 17:05

1 Answers1

1

On MacOS Catalina (10.5.2) you may have followed all the guidelines and got a similar error:

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

This is a result of curl missing openssl, which doesn't come with MacOS now. As described in https://blog.birkhoff.me/switching-to-the-openssl-version-of-curl/

To fix:

$ brew upgrade
$ brew uninstall curl
$ brew install curl-openssl
$ echo 'export PATH="/usr/local/opt/curl-openssl/bin:$PATH"' >> ~/.zshrc
David Moss
  • 11
  • 2