SSL backend error when using OpenSSL

2019-01-13 02:44发布

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

21条回答
SAY GOODBYE
2楼-- · 2019-01-13 03:41

With pip 7.1 you can put the following in your requirements file:

pycurl==7.19.5.1 --global-option="--with-nss"

Simply replace nss with the relevant ssl backend library.

查看更多
一夜七次
3楼-- · 2019-01-13 03:43

After being stuck on this for a long time, I found out that apple stopped including OpenSSL headers since OS X 10.11 El Capitan. how to fix?

1) brew install openssl

2) echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile (or .zshrc for zsh, etc)

3) pip uninstall pycurl

4) pip install --install-option="--with-openssl" --install-option="--openssl-dir=/usr/local/opt/openssl" pycurl
查看更多
beautiful°
4楼-- · 2019-01-13 03:44

I encountered this problem and Sanket Jagtap's answer worked for me. I tried the answer with the most votes answer but it did not work.

My openssl old version is 1.0.1t, I think reinstalling openssl may solve this problem.

--- pycurl's openssl backend time....

I rebuilt the latest openssl and tried this answer. Check this out.

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

This worked for me.

i recommend we should reinstall our openssl for try..

查看更多
登录 后发表回答