2

我正在做的一个项目需要 avro,它需要 python-snappy,它需要 snappy。我很难想出正确的扩展咒语来真正让所有东西一起工作。

以下 buildout.cfg 构建成功,但它将 avro 安装到develop-eggs,并且尝试引用它的任何其他内容(例如在该[test]部分中)尝试再次构建它并失败。

构建.cfg

[buildout]
eggs-directory = eggs
extensions =
    buildout.dumppickedversions
eggs =
    avro
    httplib2
    pyramid
parts =
    avro
    test
    mongodb

[snappy]
# Dependency for avro
recipe = zc.recipe.cmmi
url = http://snappy.googlecode.com/files/snappy-1.0.5.tar.gz

[avro]
recipe = zc.recipe.egg:custom
egg = avro
include-dirs = ${snappy:location}/include
library-dirs = ${snappy:location}/lib

[test]
recipe = pbp.recipe.noserunner
script = runtests
eggs =
    ${buildout:eggs}
    pbp.recipe.noserunner
    WebTest

[mongodb]
recipe = rod.recipe.mongodb
base-url = http://downloads.mongodb.org
version = 2.0.4
darwin-32bit-url = ${mongodb:base-url}/osx/mongodb-osx-i386-${mongodb:version}.tgz
darwin-64bit-url = ${mongodb:base-url}/osx/mongodb-osx-x86_64-${mongodb:version}.tgz
linux2-32bit-url = ${mongodb:base-url}/linux/mongodb-linux-i686-${mongodb:version}.tgz
linux2-64bit-url = ${mongodb:base-url}/linux/mongodb-linux-x86_64-${mongodb:version}.tgz
logpath=${buildout:parts-directory}/mongodb/log
dbpath=${buildout:parts-directory}/mongodb/data
master=true
update=true

输出

Uninstalling avro.
Updating snappy.
Installing avro.
zip_safe flag not set; analyzing archive contents...
Installing test.
Getting distribution for 'python-snappy'.
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
snappymodule.cc:28:20: error: Python.h: No such file or directory
snappymodule.cc:31:22: error: snappy-c.h: No such file or directory
snappymodule.cc:36: error: ISO C++ forbids declaration of ‘PyObject’ with no type
snappymodule.cc:36: error: expected ‘;’ before ‘*’ token
snappymodule.cc:54: error: expected initializer before ‘*’ token
snappymodule.cc:59: error: expected initializer before ‘*’ token
snappymodule.cc:43: warning: ‘_state’ defined but not used
error: Setup script exited with error: command 'gcc' failed with exit status 1
An error occurred when trying to install python-snappy 0.4. Look above this message for any errors that were output by easy_install.
While:
  Installing test.
  Getting distribution for 'python-snappy'.
Error: Couldn't install: python-snappy 0.4

是否有一种直接的方法来处理扩展依赖项与构建?我应该在这里做什么?

4

1 回答 1

4

此错误通常表示缺少开发库,可以通过以下方式解决:

$ aptitude 安装 python-devel

换句话说,它似乎与扩建无关。

于 2012-04-04T22:53:30.143 回答