Linux上的Twisted安装失败

use*_*163 17 python twisted

我试图在我的Linux服务器上从源代码安装在Linux上.当我使用此命令时setup.py install,它失败并显示以下错误消息:

twisted/runner/portmap.c:10:20: error: Python.h: No such file or directory
twisted/runner/portmap.c:14: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
twisted/runner/portmap.c:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
twisted/runner/portmap.c:45: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PortmapMethods’
twisted/runner/portmap.c: In function ‘initportmap’:
twisted/runner/portmap.c:55: warning: implicit declaration of function ‘Py_InitModule’
twisted/runner/portmap.c:55: error: ‘PortmapMethods’ undeclared (first use in this function)
twisted/runner/portmap.c:55: error: (Each undeclared identifier is reported only once
twisted/runner/portmap.c:55: error: for each function it appears in.)
error: command 'gcc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)

顺便说一句,我没有该机器的root权限,并且Python安装在我的文件夹中,而不是/usr/bin

小智 42

编译器找不到python开发头文件.要求系统管理员python-devel在CentOS的情况下安装 或安装python-dev在Debian,Ubuntu及其衍生产品上.这应该有所帮助.