【问题标题】:Why can't zc.buildout find pyconfig.h?为什么 zc.buildout 找不到 pyconfig.h?
【发布时间】:2012-03-23 21:02:28
【问题描述】:

我正在使用一个简单的 buildout.cfg 文件运行 zc.buildout:

[buildout]
parts = python

[python]
recipe = zc.recipe.egg
interpreter = python

我在 CentOS 和 Ubuntu 中收到此错误消息:

# bin/buildout 
Installing python.
Getting distribution for 'python'.
error: Setup script exited with error: pyconfig.h: No such file or directory
An error occurred when trying to install Python 2.5. Look above this message for any   errors that were output by easy_install.
While:
  Installing python.
  Getting distribution for 'python'.
Error: Couldn't install: Python 2.5

Python 开发包肯定安装好了。 pyconfig.h 在我的 Ubuntu 系统上的 /usr/include/python2.7 中。我需要以不同的方式配置构建吗?

【问题讨论】:

标签: python django zope buildout


【解决方案1】:

如果没有“egg”或“eggs”选项,我认为您没有正确使用 zc.recipe.egg?您使用您的系统/usr/bin/python2.7 bootstrap.py 引导(我只能假设),然后您收到有关 Python 2.5 的错误消息?问题似乎是 buildout 试图获得 Python 2.5 的包分发,这是没有意义的。

尝试添加一个空的 eggs= 选项——应该可以。

【讨论】:

  • 谢谢,“eggs=" 有效。我试图简化配置,但我简化了太多。由于这个遗漏,buildout 尝试将 Python 2.5 作为鸡蛋安装似乎很奇怪。
【解决方案2】:

看起来很奇怪。我怀疑您的构建中还有更多内容,尤其是一些需要编译的额外必需包。这是 buildout(或者更确切地说是 python 本身)查找头文件的正常情况。

你说.h 文件在你的 python 2.7 目录中存在得很好,但看起来 buildout 是用 python 2.5 运行的,它不能使用 2.7。

所以如果你使用的是 ubuntu,你也需要安装 python2.5 的开发包。

(但你的问题在我看来仍然很奇怪,或者说似乎缺少一些东西)。

【讨论】:

    猜你喜欢
    • 2014-09-09
    • 2018-10-07
    • 1970-01-01
    • 2021-01-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-30
    • 1970-01-01
    相关资源
    最近更新 更多