python安装pycurl错误 Exception: `curl-config' not found -- please install the libcurl development files

[root@qilincaizhe-vmlnx ~]# python -V
Python 2.7.2
[root@qilincaizhe-vmlnx ~]#easy_install pycurl
Searching for pycurl
Reading http://pypi.python.org/simple/pycurl/
Reading http://pycurl.sourceforge.net/
Reading http://pycurl.sourceforge.net/download/
Best match: pycurl 7.19.0
Downloading http://pycurl.sourceforge.net/download/pycurl-7.19.0.tar.gz
Processing pycurl-7.19.0.tar.gz
Running pycurl-7.19.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Tff8Ol/pycurl-7.19.0/egg-dist-tmp-OuwChr
Using curl-config (libcurl 7.24.0)
sh: curl-config: command not found
Traceback (most recent call last):
  File "setup.py", line 90, in
    raise Exception, ("`%s' not found -- please install the libcurl development files" % CURL_CONFIG)
Exception: `curl-config' not found -- please install the libcurl development files

[root@qilincaizhe-vmlnx ~]curl-config
-bash: curl-config: command not found

解决办法安装curl
[root@qilincaizhe-vmlnx ~]#wget http://curl.haxx.se/download/curl-7.24.0.tar.gz
[root@qilincaizhe-vmlnx ~]#tar -zxvf curl-7.24.0.tar.gz
[root@qilincaizhe-vmlnx ~]#cd curl-7.24
[root@qilincaizhe-vmlnx curl-7.24.0]#./configure
[root@qilincaizhe-vmlnx curl-7.24.0]#make
[root@qilincaizhe-vmlnx curl-7.24.0]#make install

然后
[root@qilincaizhe-vmlnx ~]wget http://pycurl.sourceforge.net/download/pycurl-7.19.0.tar.gz
[root@qilincaizhe-vmlnx ~]tar -zxvf pycurl-7.19.0.tar.gz
[root@qilincaizhe-vmlnx ~]cd pycurl-7.19.0

使用--curl-config=制定curl-config的路径
[root@qilincaizhe-vmlnx pycurl-7.19.0]python setup.py install --curl-config=/usr/local/bin/curl-config

Using /usr/local/bin/curl-config (libcurl 7.24.0)
running install
running build
running build_py
running build_ext
running install_lib
copying build/lib.linux-x86_64-2.7/pycurl.so -> /usr/lib/python2.7/site-packages
running install_data
running install_egg_info
Writing /usr/lib/python2.7/site-packages/pycurl-7.19.0-py2.7.egg-info

安装成功

你可能感兴趣的:(Python)