Twisted安装在Linux上失败

2024-09-22 16:29:34 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图从Linux服务器上的源代码在Linux上安装twisted。 当我使用此命令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

顺便说一下,我没有该计算机的根权限,并且Python安装在我的主页文件夹中,而不是/usr/bin


Tags: orintokenlinuxtwistedfunctionattributeerror
1条回答
网友
1楼 · 发布于 2024-09-22 16:29:34

编译器找不到python开发头。要求系统管理员在CentOS的情况下安装python-devel,或者在Debian、Ubuntu及其衍生物上安装python-dev。这应该会有帮助。

相关问题 更多 >