2011-12-25 33 views
17

Tôi đã cố gắng cài đặt xoắn trên Linux từ mã nguồn trên máy chủ Linux của tôi. Khi tôi sử dụng lệnh này setup.py install, nó thất bại với một thông báo lỗi dưới đây:Cài đặt Xoắn Không thành công trên 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, tôi không có quyền root trên máy đó, và Python được cài đặt trong nhà thư mục của tôi, không /usr/bin

+0

bản sao có thể có của [ubuntu: Tôi có python, nhưng gcc không thể tìm thấy Python.h] (http://stackoverflow.com/questions/8282231/ubuntu-i-have-python-but-gcc-cant-find- python-h) –

Trả lời

41

Trình biên dịch không thể tìm thấy tiêu đề phát triển python. Yêu cầu quản trị viên hệ thống cài đặt python-devel trong trường hợp CentOS hoặc cài đặt python-dev trên Debian, Ubuntu và các dẫn xuất của họ. Điều đó sẽ giúp ích.

+0

'python3-dev' nếu bạn sử dụng python3 –

Các vấn đề liên quan