2012-03-22 35 views
0

我用一個簡單的buildout.cfg文件運行zc.buildout:爲什麼zc.buildout找不到pyconfig.h?

[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。我需要配置不同的構建嗎?

+0

你爲什麼試圖構建https://pypi.python.org/pypi/Python發行版?這就是你的構建想要做的。 – 2012-03-22 21:22:34

回答

1

我不認爲你正確使用zc.recipe.egg而沒有「蛋」或「蛋」選項?你用你的系統/usr/bin/python2.7 bootstrap.py引導(我只能假設),然後你得到有關Python 2.5的錯誤信息?問題似乎是buildout試圖獲得Python 2.5的包發行版,這沒有任何意義。

嘗試添加一個空雞蛋=選項 - 這應該工作。

+0

謝謝,「雞蛋=」的作品。我試圖簡化配置,但我簡化了它太多。看起來奇怪的是,buildout試圖將Python 2.5作爲一個雞蛋安裝,因爲這種遺漏。 – mpso 2012-03-27 01:32:53

0

看起來很奇怪。我懷疑你的構建中還有更多,特別是需要編譯的額外必需包。這是buildout(或python本身)查看頭文件的正常情況。

你說.h文件在你的python 2.7目錄中存在得很好,但它看起來像使用python 2.5運行的buildout,它不能使用2.7版本。

所以,如果你在Ubuntu上,你還需要安裝python2.5的開發包。

(但是你的問題對我來說仍然很奇怪,或者更確切地說,事情似乎缺失了)。