如何通过buildout安装readline

时间:2012-01-14 17:06:51

标签: python version buildout

我想配置我的python项目以在安装过程中自动构建postgresql。 你可以这样做:

Buildout, psycopg2, postgresql

问题是我不喜欢使用

configure-options =
--without-readline

选项

这意味着我必须安装readline库。我查看了plone配置文件,我发现了一些提示,所以我将这些部分添加到了buildout.cfg中:

[readline-patch]
recipe = z3c.recipe.runscript
url = http://ftp.gnu.org/gnu/readline/readline-5.2-patches
install-script = ${buildout:directory}/bin/fetch-readline-patches.py:fetch
update-script = ${readline-patch:install-script}

[readline]
recipe = zc.recipe.cmmi
url = http://ftp.gnu.org/gnu/readline/readline-5.2.tar.gz
patch = ${readline-patch:prefix}/readline.patch
extra_options =
    --prefix = ${buildout:parts-directory}/opt

但是现在,我收到了这个错误:

Installing readline-patch.
While:
  Installing readline-patch.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "/home/mnowotka/Dokumenty/MgrFuncAdnot/app/django-gui/eggs/zc.buildout-1.5.2-  py2.7.egg/zc/buildout/buildout.py", line 1805, in main
getattr(buildout, command)(args)
  File "/home/mnowotka/Dokumenty/MgrFuncAdnot/app/django-gui/eggs/zc.buildout-1.5.2-py2.7.egg/zc/buildout/buildout.py", line 584, in install
    installed_files = self[part]._call(recipe.install)
  File "/home/mnowotka/Dokumenty/MgrFuncAdnot/app/django-gui/eggs/zc.buildout-1.5.2-py2.7.egg/zc/buildout/buildout.py", line 1297, in _call
    return f()
  File "/home/mnowotka/Dokumenty/MgrFuncAdnot/app/django-gui/eggs/z3c.recipe.runscript-0.1.3-py2.7.egg/z3c/recipe/runscript/__init__.py", line 39, in install
    self.callScript(script)
  File "/home/mnowotka/Dokumenty/MgrFuncAdnot/app/django-gui/eggs/z3c.recipe.runscript-0.1.3-py2.7.egg/z3c/recipe/runscript/__init__.py", line 28, in callScript
    module = imp.load_source('script', filename)
IOError: [Errno 2] No such file or directory

任何帮助它的工作都将不胜感激。

1 个答案:

答案 0 :(得分:0)

z3c.recipe.runscript没有网址选项。因此不会下载该脚本。您可以使用本地脚本,该脚本将下载文件并执行它。或者使用http://pypi.python.org/pypi/collective.recipe.scriptgen通过buildout创建脚本,该脚本将通过curl

下载文件