python2.7 安装 twisted 出错

2015-01-12 14:35:12 +08:00
 yakczh
easy_install twisted

Searching for twisted
Reading http://pypi.python.org/simple/twisted/
Best match: Twisted 14.0.2
Downloading https://pypi.python.org/packages/source/T/Twisted/Twisted-14.0.2.tar.bz2#md5=8379eb15601d6b7543a189594d3fed8f
Processing Twisted-14.0.2.tar.bz2
Running Twisted-14.0.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-U2BWEm/Twisted-14.0.2/egg-dist-tmp-Kf7DWe
twisted/runner/portmap.c:10:20: 错误:Python.h:没有那个文件或目录
twisted/runner/portmap.c:14: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
twisted/runner/portmap.c:31: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
twisted/runner/portmap.c:45: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PortmapMethods’
twisted/runner/portmap.c: 在函数‘initportmap’中:
twisted/runner/portmap.c:55: 警告:隐式声明函数‘Py_InitModule’
twisted/runner/portmap.c:55: 错误:‘PortmapMethods’未声明(在此函数内第一次使用)
twisted/runner/portmap.c:55: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
twisted/runner/portmap.c:55: 错误:所在的函数内也只报告一次。)
error: Setup script exited with error: command 'gcc' failed with exit status 1

系统是CentOS release 6.5
是不是先要安装python源码?
3872 次点击
所在节点    问与答
1 条回复
skybr
2015-01-12 14:51:59 +08:00
yum装python-devel, 不过twisted建议virtualenv后再装, 用pip装global的库可能会造成版本破坏,引起不可预料的后果。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/161401

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX