当前位置: > Linux故障 >

pip install pycurl报错error: command 'gcc' failed with exit status 1

时间:2015-01-10 13:07来源:linux.it.net.cn 作者:IT
运行pip install pycurl安装pycurl时输出下面信息并报错:
 
 
Downloading/unpacking pycurl
  Downloading pycurl-7.19.5.tar.gz (107kB): 107kB downloaded
  Running setup.py (path:/tmp/pip_build_root/pycurl/setup.py) egg_info for package pycurl
    Using curl-config (libcurl 7.19.7)
    
Installing collected packages: pycurl
  Running setup.py install for pycurl
    Using curl-config (libcurl 7.19.7)
    building 'pycurl' extension
    gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPYCURL_VERSION="7.19.5" -DHAVE_CURL_SSL=1 -I/usr/local/include/python2.7 -c src/docstrings.c -o build/temp.linux-i686-2.7/src/docstrings.o
    In file included from src/docstrings.c:4:
    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"
    gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPYCURL_VERSION="7.19.5" -DHAVE_CURL_SSL=1 -I/usr/local/include/python2.7 -c src/easy.c -o build/temp.linux-i686-2.7/src/easy.o
    In file included from src/easy.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/easy.c: In function ‘do_curl_getinfo’:
    src/easy.c:1985: warning: call to ‘_curl_easy_getinfo_err_curl_slist’ declared with attribute warning: curl_easy_getinfo expects a pointer to struct curl_slist * for this info
    gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPYCURL_VERSION="7.19.5" -DHAVE_CURL_SSL=1 -I/usr/local/include/python2.7 -c src/module.c -o build/temp.linux-i686-2.7/src/module.o
    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
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/pycurl/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-i1I52C-record/install-record.txt --single-version-externally-managed --compile:
    Using curl-config (libcurl 7.19.7)
    
running install
    
running build
    
running build_py
    
creating build
    
creating build/lib.linux-i686-2.7
    
creating build/lib.linux-i686-2.7/curl
    
copying python/curl/__init__.py -> build/lib.linux-i686-2.7/curl
    
running build_ext
    
building 'pycurl' extension
    
creating build/temp.linux-i686-2.7
    
creating build/temp.linux-i686-2.7/src
    
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPYCURL_VERSION="7.19.5" -DHAVE_CURL_SSL=1 -I/usr/local/include/python2.7 -c src/docstrings.c -o build/temp.linux-i686-2.7/src/docstrings.o
    
In file included from src/docstrings.c:4:
    
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"
    
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPYCURL_VERSION="7.19.5" -DHAVE_CURL_SSL=1 -I/usr/local/include/python2.7 -c src/easy.c -o build/temp.linux-i686-2.7/src/easy.o
    
In file included from src/easy.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/easy.c: In function ‘do_curl_getinfo’:
    
src/easy.c:1985: warning: call to ‘_curl_easy_getinfo_err_curl_slist’ declared with attribute warning: curl_easy_getinfo expects a pointer to struct curl_slist * for this info
    
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPYCURL_VERSION="7.19.5" -DHAVE_CURL_SSL=1 -I/usr/local/include/python2.7 -c src/module.c -o build/temp.linux-i686-2.7/src/module.o
    
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
    
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/pycurl/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-i1I52C-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/pycurl
Storing debug log for failure in /root/.pip/pip.log
 
 
我的操作系统是centos6.5,为了安装scrapy把python升级到了2.7,由于yum不支持2.7所以单独使yum调用python2.6,现在网络上有很多升级教程。
 
我使用pip install pycurl安装pycurl时报error: command 'gcc' failed with exit status 1错误,很多人都说安装python-dev就可以了,经过尝试,果然通过。
(责任编辑:IT)
------分隔线----------------------------