且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用OpenSSL时出现SSL后端错误

更新时间:2022-10-15 16:59:47

读取INSTALLATION文件后,我的问题通过设置环境变量并重新安装




  • 删除现有 pycurl 安装



    pip uninstall pycurl


  • p>导出变量与您的链接时间ssl后端(以上是openssl)

    export PYCURL_SSL_LIBRARY = openssl


  • 然后重新安装 pycurl



    pip install pycurl




但是这对我在 virtualenv pip 安装完美。


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

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

    pip install pycurl

There could be other solution out there but this works perfectly for me on a virtualenv and pip installation.