开发者

Install pycairo or py2cairo using buildout

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.开发者_JS百科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.


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜