繁体   English   中英

如何在CentOS 6.4上安装urwid 1.1.1?

[英]how to install urwid 1.1.1 on CentOS 6.4?

要在CentOS 6.4上安装urwid 1.1.1,我已经尝试过:

yum install python-urwid

会安装urwid 0.9.9。

然后,我手动下载了urwid 1.1.1并运行:

cd /mnt/hgfs/Shared/urwid-1.1.1
python ./setup.py install

就像在线手册上说的那样。

这导致以下错误:

[root@localhost ~]# cd /mnt/hgfs/Shared/urwid-1.1.1
[root@localhost urwid-1.1.1]# python ./setup.py install
running install
running build
running build_py
running build_ext
building 'urwid.str_util' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.6 -c source/str_util.c -o build/temp.linux-x86_64-2.6/source/str_util.o
source/str_util.c:25:20: error: Python.h: No such file or directory
source/str_util.c:88: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
source/str_util.c:100: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
source/str_util.c:121: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
source/str_util.c:169: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
source/str_util.c:190: error: expected declaration specifiers or ‘...’ before ‘Py_ssize_t’
source/str_util.c:191: error: expected declaration specifiers or ‘...’ before ‘Py_ssize_t’
source/str_util.c:191: error: expected declaration specifiers or ‘...’ before ‘Py_ssize_t’
source/str_util.c: In function ‘Py_DecodeOne’:
source/str_util.c:195: error: ‘pos’ undeclared (first use in this function)
source/str_util.c:195: error: (Each undeclared identifier is reported only once
source/str_util.c:195: error: for each function it appears in.)
source/str_util.c:197: error: ‘ret’ undeclared (first use in this function)
source/str_util.c:202: error: ‘text_len’ undeclared (first use in this function)
source/str_util.c: At top level:
source/str_util.c:319: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
source/str_util.c:351: error: expected declaration specifiers or ‘...’ before ‘Py_ssize_t’
source/str_util.c:352: error: expected declaration specifiers or ‘...’ before ‘Py_ssize_t’
source/str_util.c:352: error: expected declaration specifiers or ‘...’ before ‘Py_ssize_t’
source/str_util.c: In function ‘Py_DecodeOneRight’:
source/str_util.c:354: error: ‘Py_ssize_t’ undeclared (first use in this function)
source/str_util.c:354: error: expected ‘;’ before ‘subret’
source/str_util.c:356: error: ‘pos’ undeclared (first use in this function)
source/str_util.c:360: error: ‘text_len’ undeclared (first use in this function)
source/str_util.c:360: error: ‘subret’ undeclared (first use in this function)
source/str_util.c:360: error: too many arguments to function ‘Py_DecodeOne’
source/str_util.c:361: error: ‘ret’ undeclared (first use in this function)
source/str_util.c: At top level:
source/str_util.c:377: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
source/str_util.c:413: error: expected declaration specifiers or ‘...’ before ‘Py_ssize_t’
source/str_util.c:414: error: expected declaration specifiers or ‘...’ before ‘Py_ssize_t’
source/str_util.c: In function ‘Py_WithinDoubleByte’:
source/str_util.c:416: error: ‘Py_ssize_t’ undeclared (first use in this function)
source/str_util.c:416: error: expected ‘;’ before ‘i’
source/str_util.c:418: error: ‘pos’ undeclared (first use in this function)
source/str_util.c:421: error: ‘line_start’ undeclared (first use in this function)
source/str_util.c:425: error: too many arguments to function ‘Py_WithinDoubleByte’
source/str_util.c:432: error: ‘i’ undeclared (first use in this function)
source/str_util.c: At top level:
source/str_util.c:440: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
source/str_util.c:476: error: expected ‘)’ before ‘*’ token
source/str_util.c:519: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
source/str_util.c:546: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Py_MovePrevChar’
source/str_util.c:576: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
source/str_util.c:599: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Py_MoveNextChar’
source/str_util.c:630: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
source/str_util.c:653: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Py_CalcWidth’
source/str_util.c:708: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
source/str_util.c:739: error: expected ‘)’ before ‘*’ token
source/str_util.c:835: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
source/str_util.c:855: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Str_UtilMethods’
source/str_util.c:874: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘initstr_util’
source/str_util.c: In function ‘main’:
source/str_util.c:882: warning: implicit declaration of function ‘Py_SetProgramName’
source/str_util.c:885: warning: implicit declaration of function ‘Py_Initialize’
source/str_util.c:888: warning: implicit declaration of function ‘initstr_util’
error: command 'gcc' failed with exit status 1
[root@localhost urwid-1.1.1]# 

当前已安装Python 2.6和gcc 4.4.7。

可以请任何人解释该错误并提出解决方案吗?

谢谢!

yum install python-devel应该可以解决您的问题,因为缺少的是编译所需的Python.h C头文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM