0.问题
前几天试图在centos上按装pycurl,本以为已轻车熟路:pip install pycurl
;
没想到却出现了一堆错误(只截取部分):
In file included from src/module.c:1:
src/pycurl.h:152:5: warning: #warning "libcurl was compiled with SSL support, but configure could not determine which " "library was used; thus no SSL crypto locking callbacks will be set, which may " "cause random crashes on SSL requests"
src/module.c: In function ‘initpycurl’:
src/module.c:723: error: ‘CURLPROTO_IMAP’ undeclared (first use in this function)
src/module.c:723: error: (Each undeclared identifier is reported only once
src/module.c:723: error: for each function it appears in.)
src/module.c:724: error: ‘CURLPROTO_IMAPS’ undeclared (first use in this function)
src/module.c:725: error: ‘CURLPROTO_POP3’ undeclared (first use in this function)src/module.c:726: error: ‘CURLPROTO_POP3S’ undeclared (first use in this function)
src/module.c:727: error: ‘CURLPROTO_SMTP’ undeclared (first use in this function)
src/module.c:728: error: ‘CURLPROTO_SMTPS’ undeclared (first use in this function)
src/module.c:729: error: ‘CURLPROTO_RTSP’ undeclared (first use in this function)src/module.c:730: error: ‘CURLPROTO_RTMP’ undeclared (first use in this function)
src/module.c:731: error: ‘CURLPROTO_RTMPT’ undeclared (first use in this function)
src/module.c:732: error: ‘CURLPROTO_RTMPE’ undeclared (first use in this function)
src/module.c:733: error: ‘CURLPROTO_RTMPTE’ undeclared (first use in this function)
src/module.c:734: error: ‘CURLPROTO_RTMPS’ undeclared (first use in this function)
src/module.c:735: error: ‘CURLPROTO_RTMPTS’ undeclared (first use in this function)
src/module.c:736: error: ‘CURLPROTO_GOPHER’ undeclared (first use in this function)
error: command 'gcc' failed with exit status 1
1.原因
尝试了其他方法也有类似问题。
折腾了半天,发现竟然是libcurl版本太低了,但是yum告诉我我已经安装了最新版本的libcurl。
然后还得出了一个结论,centos实在是太太保守了。所谓的最新居然是4年前的版本。
2.解决方法
知道了原因就好解决了。
- 直接上http://curl.haxx.se/download.html下载最新版本的curl源码。
- 解压curl
- 安装curl
make
->make install
- 安装pycurl
pip install pycurl
Done