使用 buildout 安装 pycairo 或 py2cairo

发布于 2024-12-03 21:42:41 字数 2081 浏览 3 评论 0 原文

有人有尝试使用 buildout 为 django 安装 cairo 的经验吗? 它将安装 pycairo 或 py2cairo (第一个适用于 python >3.0,最新的是适用于我正在使用的 python 2.6)

我找到了 2 个用于安装的食谱,它们都给了我错误,在 buildout.cfg 中我有它们作为两部分(当然单独尝试,而不是一起尝试)。 错误完全不同,但结果是相同的:我无法使用 buildout 安装 cairo.......

基于: http://pypi.python.org/pypi/tl.buildout_gtk/

[cairo_tl]
recipe = tl.buildout_gtk
#pycairo-url = http://cairographics.org/releases/py2cairo-1.10.0.tar.bz2
pycairo-url =   http://cairographics.org/releases/py2cairo-1.8.10.tar.gz
pycairo-md5sum = http://cairographics.org/releases/py2cairo-1.8.10.tar.gz.md5

基于:https://bitbucket.org/lgs/yaco.recipe.pycairo

[cairo_yaco]  
recipe = yaco.recipe.pycairo  
find-links = http://pypi.python.org/pypi/yaco.recipe.pycairo/0.1.1  
#find-links = http://pypi.python.org/pypi/yaco.recipe.pycairo/0.1  
# pkg-config-path ?

两者都需要本地安装 cairo(pycairo 和 py2cairo 依赖于此): 所以在服务器上使用:

sudo apt-get install libcairo2-dev

使用 tl.buildout_gtk 的部分:

使用 py2cairo-1.10.0 或 pycairo-1.8.2 给我一个 MD5 校验和不匹配 (有关可用版本,请参阅:http://cairgraphics.org/releases/) 例如:

Error: MD5 checksum mismatch downloading 'http://cairographics.org/releases/py2cairo-1.10.0.tar.bz2'

或:

Error: MD5 checksum mismatch downloading 'http://cairographics.org/releases/py2cairo-1.8.10.tar.gz'

使用 yaco 的部分:

我很确定这部分配置不正确(pkg-config-path 指的是本地 cairo 包),但我什至没有达到这一点。 它给出了一个错误:

DistributionNotFound: zc.recipe.cmmi

然而,这是安装在鸡蛋中

顺便说一句,我在尝试通过buildout安装PIL时也遇到了同样的头痛,我结合了互联网上的很多选项和帖子以及很多时间和尝试与错误。 如果有人想知道我最终是如何让它发挥作用的,尽管问,我会发布它。 (我认为自己仍然是 django 入门者,所以我不确定是否有人对该解决方案感兴趣)

PIL 没有我在 cairo 中找到的所有选项,所以我开始使用 cairo。在我的本地电脑上一切正常(ubuntu桌面),在我的服务器(Ubuntu服务器)上我无法让它工作...... 任何其他用于动态绘图的选项...(例如 matplotlib...)请告诉我。

Does anyone have any experience with trying to install cairo for django using buildout?
It will install pycairo or py2cairo (the first is for python >3.0, the latest is for python 2.6, which I Am using)

I found 2 recipes to use for installation, both of them gives me errors, in buildout.cfg I have them as 2 parts (of course tried them seperately, not thogether).
The errors are totally different, but the result is the same: I can't get cairo installed using buildout.......

based on: http://pypi.python.org/pypi/tl.buildout_gtk/

[cairo_tl]
recipe = tl.buildout_gtk
#pycairo-url = http://cairographics.org/releases/py2cairo-1.10.0.tar.bz2
pycairo-url =   http://cairographics.org/releases/py2cairo-1.8.10.tar.gz
pycairo-md5sum = http://cairographics.org/releases/py2cairo-1.8.10.tar.gz.md5

based on: https://bitbucket.org/lgs/yaco.recipe.pycairo

[cairo_yaco]  
recipe = yaco.recipe.pycairo  
find-links = http://pypi.python.org/pypi/yaco.recipe.pycairo/0.1.1  
#find-links = http://pypi.python.org/pypi/yaco.recipe.pycairo/0.1  
# pkg-config-path ?

Both need a local install of cairo (pycairo and py2cairo depend on this):
so use on the server:

sudo apt-get install libcairo2-dev

The part jusing tl.buildout_gtk:

Either using the py2cairo-1.10.0 or pycairo-1.8.2 gives me a MD5 checksum mismatch
(see for available releases: http://cairographics.org/releases/)
e.g:

Error: MD5 checksum mismatch downloading 'http://cairographics.org/releases/py2cairo-1.10.0.tar.bz2'

or:

Error: MD5 checksum mismatch downloading 'http://cairographics.org/releases/py2cairo-1.8.10.tar.gz'

The part jusing yaco:

I Am pretty sure this part is not configured correctly (pkg-config-path refering to the local cairo package), but I do not even get to that point.
It gives an error:

DistributionNotFound: zc.recipe.cmmi

However, this is installed in the eggs

By the way, I had the same kind of headache trying to install PIL by buildout, which I solved combining a lot of options and posts on the internet, together with a lot of time and trials and errors.
If anyone want to know how I finally got it working, just ask, and I will publish it.
(I consider myselve still a django starter, so I do not know for sure if anyone is interested in the solution)

PIL does not have all the options I found in cairo, so I started using cairo. On my local PC everything works fine (ubuntu desktop), on my server (Ubuntu server) I can't getting it to work......
Any other options for making drawings on the fly..... (like matplotlib...) let me know.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

围归者 2024-12-10 21:42:41

很确定你必须将真正的 md5 哈希值提供给 pycairo-md5 选项,而不是其中包含某些 url 的字符串。

Pretty sure you have to give the real md5 hash to the pycairo-md5 option instead of a string with some url in it.

妄想挽回 2024-12-10 21:42:41

我会尽可能避免像这两个这样的专门食谱。在某些情况下,确实需要专门的配方,但在这些情况下,依赖关系非常古怪,以至于没有可用的通用构建/安装模式。我不知道 pycairo 所以可能是这样。

但在做出假设之前,请尝试以下操作。始终首先尝试使用鸡蛋,将其添加到相关构建部分的eggs选项中。如果这不起作用,请使用这些详细信息更新您的问题,然后尝试使用 构建选项可能有助于发行版成功构建。如果这不起作用或者发行版使用 ./configure &&制作&& make install (又名“CMMI”)构建系统,使用这些详细信息更新您的问题,然后尝试使用 zc.recipe.cmmi 构建包,之后您可以使用 额外路径< zc.recipe.egg 部分的 /a> 选项包含 CMMI 部分的相关位 (extra-paths = ${cmmi-part:location}/weird/path/to/python/modules)。

这是获得表现不佳/奇怪的发行版的一般舞蹈。如果这不起作用,那么可能需要一个专门的配方,但总的来说,有一种方法可以让它与上述方法一起工作,并且这将更易于维护。

I would avoid specialized recipes like those two whenever possible. There are some cases when a specialized recipe really is needed, but those are cases where the dependency is so egregiously eccentric that no common build/install pattern is usable. I don't know pycairo so that may be the case.

But before assuming it is, try the following. Always try using an egg first by adding it to the eggs option of the relevant buildout part. If that doesn't work, update your question with those details, and then try adding a separate zc.recipe.egg part with build options that may help the distribution build successfully. If that doesn't work or the distribution uses a ./configure && make && make install (AKA "CMMI") build system, update your question with those details, and then try using zc.recipe.cmmi to build the package after which you can use the extra-paths option of your zc.recipe.egg part to include the relevant bits of the CMMI part (extra-paths = ${cmmi-part:location}/weird/path/to/python/modules).

This is the general dance for getting poorly/oddly behaved distributions. If this doesn't work, then a specialized recipe may be in order but in general there's a way to get it to work with the above and that will be much more maintainable.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文