问题
I am including in a buildout an egg (jsonlib) that uses C extensions.
On pypi a precompiled blob is present. But it's not compatible with my environment: I get a undefined symbol: PyUnicodeUCS4_FromEncodedObject
error.
I know this has to do with different environments at compile time and runtime.
To solve it buildout should compile the package instead of using the prebuilt one.
How do I tell buildout to compile a package (all packages would be fine too) no matter what precompiled egg files it finds on pypi?
回答1:
There you go:
[buildout]
parts = getit
# used to show which download was fetched
download-cache = .
[getit]
recipe = zc.recipe.egg
# this is the first key: ignore using the pypi index
index = .
# this is the second key: provide a direct link to the sdist
find-links = https://pypi.python.org/packages/source/h/hachoir-core/hachoir-core-1.3.3.tar.gz
eggs = hachoir-core==1.3.3
And to do this only for some OS using conditional sections (disclaimer, I wrote this) with the latest version of buildout:
[buildout]
parts = getit
download-cache = .
[getit: macosx]
recipe = zc.recipe.egg
index = .
find-links = https://pypi.python.org/packages/source/h/hachoir-core/hachoir-core-1.3.3.tar.gz
eggs = hachoir-core==1.3.3
[getit: not macosx]
recipe = zc.recipe.egg
# use pypi alright
eggs = hachoir-core==1.3.3
after running this, check the dist dir, it will have a copy of the fetched archive for verification: no prebuilt eggs in there ;)
来源:https://stackoverflow.com/questions/8852842/how-do-i-tell-buildout-to-ignore-a-binary-distribution-and-build-from-source-ins