天天看點

ImportError: pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend

[[email protected]_0_10_centos 529]# python3

Python 3.6.2 (default, Jun 20 2018, 09:40:19)

[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>> import pycurl

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

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

solution:

pip3 uninstall pycurl

export PYCURL_SSL_LIBRARY=nss

pip3 install --ignore-installed pycurl

備注:如果uninstall無法移除,則手動移除

mv /usr/local/python3/lib/python3.6/site-packages/pycurl* /home

SSL庫可以通過curl -V檢視

$curl -V

curl 7.24.0 (x86_64-unknown-linux-gnu) libcurl/7.29.0 NSS/3.34 zlib/1.2.7 libidn/1.28 libssh2/1.4.3

Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp

Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz