2011-12-25 71 views
17

我試圖在我的Linux服務器上從源代碼安裝Linux上的扭曲。 當我使用這個命令setup.py install,它具有以下錯誤消息失敗:Linux上的扭曲安裝失敗

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 

BTW,我沒有那個機器上的root權限,Python安裝在我家,不/usr/bin

+0

可能重複[ubuntu:我有python,但gcc無法找到Python.h](http://stackoverflow.com/questions/8282231/ubuntu-i-have-python-but-gcc-cant-find- python-h) – 2011-12-31 20:13:44

回答

41

編譯器無法找到python開發標頭。要求系統管理員在CentOS上安裝python-devel或在Debian,Ubuntu及其衍生產品上安裝python-dev。這應該有所幫助。

+0

'python3-dev' if you use python3 – 2018-03-01 11:41:52