V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
yakczh
V2EX  ›  问与答

python2.7 安装 twisted 出错

  •  
  •   yakczh · 2015-01-12 14:35:12 +08:00 · 3865 次点击
    这是一个创建于 3411 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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源码?
    1 条回复    2015-01-12 14:51:59 +08:00
    skybr
        1
    skybr  
       2015-01-12 14:51:59 +08:00
    yum装python-devel, 不过twisted建议virtualenv后再装, 用pip装global的库可能会造成版本破坏,引起不可预料的后果。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1406 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 23:41 · PVG 07:41 · LAX 16:41 · JFK 19:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.