SSL backend error when using OpenSSL

前端 未结 26 2302
北恋
北恋 2020-11-30 22:38

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         


        
26条回答
  •  有刺的猬
    2020-11-30 23:39

    I'm on CentOS 7. I tried all of the above and couldn't get anything to work. It turns out I needed to run these as a root user. So if you're having trouble, try any of the above solutions as a root user. As an example, here is what worked for me:

    su -
    pip uninstall pycurl
    export PYCURL_SSL_LIBRARY=[nss|openssl|ssl|gnutls]
    pip install pycurl
    

    Of course, all the usual disclaimers about running as a root user apply.

    Note: [nss|openssl|ssl|gnutls] in the code above means to pick one, and don't include the square brackets or pipes. The person who asked the original question would have chosen openssl. In my particular case, I chose nss. Your error message should tell you which choice to make.

    2019 Edit: Doing a sudo pip install might cause a problem with the machine's system install of Python. Perhaps try working in a Python virtual environment and install the packages there. If that doesn't work, the sudo trick in my answer is probably one of the last options to consider.

提交回复
热议问题