python3版本导入pycurl报错问题:import pycurl

时间:2024-03-18 20:15:23

报错提示:

ImportError: pycurl: libcurl link-time version (7.29.0) is older than compile-time version (7.61.0)

其实是跟libcurl有关,虽然已经编译按装了最新的版本,但导入pycurl 时,使用老版本问题,却不支持

最新版本curl:末尾补充编译安装

[[email protected] curl-7.61.0]# curl -V
curl 7.61.0 (x86_64-pc-linux-gnu) libcurl/7.61.0 OpenSSL/1.0.2k zlib/1.2.7
Release-Date: 2018-07-11
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets HTTPS-proxy 

查看显示:curl-7.29.0-51.el7.x86_64

[[email protected] curl-7.61.0]# rpm -qa curl
curl-7.29.0-51.el7.x86_64

rpm方式卸载旧版本:

[[email protected] curl-7.61.0]# rpm -e --nodeps curl-7.29.0-51.el7.x86_64
[[email protected] curl-7.61.0]# rpm -qa curl
[[email protected] curl-7.61.0]# export LD_LIBRARY_PATH=/usr/local/lib
[[email protected] curl-7.61.0]# echo $?
0
卸载在重新安装pycurl:

[[email protected] curl-7.61.0]# pip3 uninstall pycurl

[[email protected] curl-7.61.0]# pip3 install pycurl

python3版本导入pycurl报错问题:import pycurl

总结:是curl新旧版本冲突

补充:编译安装

[[email protected] ~]# cd /home/cainiao/tools/

[[email protected] tools]#wget https://curl.haxx.se/download/curl-7.61.0.tar.gz

[[email protected] tools]#tar -zxf curl-7.61.0.tar.gz 

[[email protected] curl-7.61.0]# cd curl-7.61.0
[[email protected] curl-7.61.0]# ./configure
[[email protected] curl-7.61.0]#make && make install
[[email protected] curl-7.61.0]#export LD_LIBRARY_PYTH=/usr/local/lib

 

希望对看官有帮助..........转载请注明原处,谢谢!!