Ошибка установки Twisted в Linux - PullRequest
17 голосов
/ 25 декабря 2011

Я пытался установить 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

Кстати, у меня нет прав root на этом компьютере, и Python установлен в моей папке home , а не /usr/bin

1 Ответ

42 голосов
/ 25 декабря 2011

Компилятор не может найти заголовки разработки Python.Попросить системного администратора установить python-devel в случае CentOS или установить python-dev в Debian, Ubuntu и их производных.Это должно помочь.

...