【问题标题】:command 'gcc' failed with exit status 1 (installing psyco)命令“gcc”失败,退出状态为 1(安装 psyco)
【发布时间】:2012-04-10 11:17:13
【问题描述】:

我运行 Ubuntu 11.10,gcc 版本 4.6.1。

我一直在尝试安装 psyco,但一直收到此错误:

PROCESSOR = 'i386'
running build
running build_py
running build_ext
building 'psyco._psyco' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DALL_STATIC=1 -Ic/i386 -I/usr/include/python2.7 -c c/psyco.c -o build/temp.linux-i686-2.7/c/psyco.o
In file included from c/initialize.h:55:0,
                 from c/psyco.c:14:
c/mergepoints.c:242:3: error: ‘JUMP_IF_FALSE’ undeclared here (not in a function)
c/mergepoints.c:242:3: error: ‘JUMP_IF_TRUE’ undeclared here (not in a function)
c/codegen.c:127:19: warning: ‘psyco_source_condition’ defined but not used [-Wunused-function]
c/codegen.c:747:10: warning: ‘integer_lshift’ defined but not used [-Wunused-function]
c/Objects/plistobject.c:115:10: warning: ‘PsycoList_SingletonNew’ defined but not used [-Wunused-function]
error: command 'gcc' failed with exit status 1

我已经安装了 python-setuptools,但到目前为止没有任何效果。感谢您的任何建议。

【问题讨论】:

  • 尝试安装 build-essential 以及 python2.x-dev(其中 x 是您的 python 版本)
  • 两个都试过了,都安装到最新版本了
  • Psyco 几乎死了。如果您需要速度,请考虑使用 Cython 或 PyPy。

标签: python gcc compiler-errors


【解决方案1】:

Google 是您的朋友:psyco 不构建 Python 2.7,也不能与 Python 2.7 一起使用,如相应的 Ubuntu bug report 中所述。

为什么需要 Psyco?如果您需要优化紧密循环,Cython 可能会为您提供帮助。

【讨论】:

    【解决方案2】:

    也许你应该得到“https://github.com/develersrl/gccwinbinaries”安装路径:C:/mingw和安装路径:C:/mingw/bin。最后在python安装目录D:/Python26/Lib/distutils找到distutils.cfg

    【讨论】:

    • [构建] 编译器=mingw32
    • 提问者表示他们使用的是 Ubuntu,一个 linux 发行版,而您的回答是特定于 Windows 的,并且完全针对您的安装。
    猜你喜欢
    • 2023-03-08
    • 1970-01-01
    • 2011-11-11
    • 1970-01-01
    • 1970-01-01
    • 2012-06-21
    • 2019-12-01
    • 2016-11-01
    • 2023-03-19
    相关资源
    最近更新 更多