Python 未声明(首次在此函数中使用)

Python 未声明(首次在此函数中使用),python,linux,pycurl,Python,Linux,Pycurl,您好,我在安装pycurl时遇到以下错误(pip安装pycurl) 我们正在使用CentOS 6.4版 pycurl在requirement.txt中,但即使我尝试单独安装它,它也会失败 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 crypt

您好,我在安装pycurl时遇到以下错误(pip安装pycurl)

我们正在使用CentOS 6.4版

pycurl在requirement.txt中,但即使我尝试单独安装它,它也会失败

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-Uf0WAn-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/pycurl
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
  File "/usr/lib/python2.6/site-packages/pip-1.5.6-py2.6.egg/pip/__init__.py", line 185, in main
return command.main(cmd_args)
  File "/usr/lib/python2.6/site-packages/pip-1.5.6-py2.6.egg/pip/basecommand.py", line 161, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 28: ordinal not in range(128)
src/pycurl.h:152:5:warning:#warning“libcurl是使用SSL支持编译的,但configure无法确定使用了哪个“”库;因此不会设置SSL加密锁定回调,这可能“导致SSL请求随机崩溃”
src/module.c:在函数“initpycurl”中:
src/module.c:723:错误:“CURLPROTO_IMAP”未声明(首次在此函数中使用)
src/module.c:723:error:(每个未声明的标识符只报告一次
src/module.c:723:错误:对于它出现在中的每个函数。)
src/module.c:724:错误:“CURLPROTO_IMAPS”未声明(首次在此函数中使用)
src/module.c:725:错误:“CURLPROTO_POP3”未声明(首次在此函数中使用)
src/module.c:726:错误:“CURLPROTO_POP3S”未声明(首次在此函数中使用)
src/module.c:727:错误:“CURLPROTO_SMTP”未声明(此函数首次使用)
src/module.c:728:错误:“CURLPROTO_SMTPS”未声明(首次在此函数中使用)
src/module.c:729:错误:“CURLPROTO_RTSP”未声明(首次在此函数中使用)
src/module.c:730:错误:“CURLPROTO_RTMP”未声明(首次在此函数中使用)
src/module.c:731:错误:“CURLPROTO\u RTMPT”未声明(首次在此函数中使用)
src/module.c:732:错误:“CURLPROTO_RTMPE”未声明(首次在此函数中使用)
src/module.c:733:错误:“CURLPROTO\u RTMPTE”未声明(首次在此函数中使用)
src/module.c:734:错误:“CURLPROTO_RTMPS”未声明(首次在此函数中使用)
src/module.c:735:错误:“CURLPROTO_RTMPTS”未声明(首次在此函数中使用)
src/module.c:736:错误:“CURLPROTO_GOPHER”未声明(首次在此函数中使用)
错误:命令“gcc”失败,退出状态为1
----------------------------------------
清理。。。
Command/usr/bin/python-c“导入setuptools,tokenize;_文件_=”/tmp/pip_构建_根/pycurl/setup.py';exec(compile(getattr(tokenize,'open',open)(__u文件__u)。read().replace('\r\n','\n'),_u文件‘,'exec'))”安装--record/tmp/pip-Uf0WAn-record/install-record.txt--外部管理的单一版本--编译失败,错误代码为/tmp/pip\u build\u root/pycurl中的1
回溯(最近一次呼叫最后一次):
文件“/usr/bin/pip”,第9行,在
加载入口点('pip==1.5.6','console脚本','pip')()
文件“/usr/lib/python2.6/site packages/pip-1.5.6-py2.6.egg/pip/_init__.py”,主文件第185行
return command.main(cmd_args)
文件“/usr/lib/python2.6/site packages/pip-1.5.6-py2.6.egg/pip/basecommand.py”,第161行,在main中
text='\n'.连接(完成日志)
UnicodeDecodeError:“ascii”编解码器无法解码第28位的字节0xe2:序号不在范围内(128)
这是完整的跟踪


有解决此问题的方法吗?

您使用的是哪个发行版(和版本)?您是否安装了发行版中与
curl-dev
openssl-dev
,以及
pycurl
相关的其他要求?您可能需要为curl安装/更新(C语言)开发包,该包应包含定义GCC抱怨的符号的头文件。你能试着打包安装“libcurl-dev”或类似的软件包吗?请注意最后一段:-你可能需要知道如何告诉它你使用的是SSL后端。curl-dev,openssl-dev已安装,不知道我是否缺少任何要求请看pycurl,其中提到升级curl库是一种方法。