我正在尝试安装readline-6.2时出现gcc错误

时间:2014-03-04 08:11:12

标签: python gcc centos

当我在CentOS服务器上为新安装的python2.7安装readline模块时,有人可以帮我解决gcc的问题吗?

gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC     -DHAVE_RL_CALLBACK -DHAVE_RL_CATCH_SIGNAL -DHAVE_RL_COMPLETION_APPEND_CHARACTER -    DHAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK -DHAVE_RL_COMPLETION_MATCHES -    DHAVE_RL_COMPLETION_SUPPRESS_APPEND -DHAVE_RL_PRE_INPUT_HOOK -I. -I/usr/local/include/python2.7 -c     Modules/2.x/readline.c -o build/temp.linux-x86_64-2.7/Modules/2.x/readline.o -Wno-strict-prototypes
gcc -pthread -shared build/temp.linux-x86_64-2.7/Modules/2.x/readline.o readline/libreadline.a     readline/libhistory.a -lncurses -o build/lib.linux-x86_64-2.7/readline.so
gcc: readline/libreadline.a: No such file or directory
gcc: readline/libhistory.a: No such file or directory
error: command 'gcc' failed with exit status 1

非常感谢!

2 个答案:

答案 0 :(得分:35)

readline与Python模块捆绑在一起,它会尝试为您构建它,但如果您的系统无法完成构建,您将看到此错误显示。就我而言,系统中缺少patchyum install patch为我解决了这个问题。

答案 1 :(得分:5)

在Ubuntu上 sudo apt-get install python-setuptools python-dev ncurses-dev