torsdag den 31. januar 2008

Installing ZMySQLDA in Zope using buildout on Ubuntu and perhaps Debian in general

Another note to future self. This is how I did it.


To make Zope work with Mysql I needed to compile the database adapter. For this I needed the mysql dev libraries. On Ubuntu that is done like this:
aptitude install libmysql++-dev


For ZMySQLDA to work I needed the plain Python MySQL-Python library installed and compiled.

Luckily the MySQL-Python package is distributed as an egg, so it can just be added to buildout.cfg
eggs =
... other packages
Buildout will then download, compile and install the package automatically.


ZMySQLDA is old. Latest release 2.0.8 is from 2001. But that is just because it is stable. No worry.

When I tried to install it with by adding it in the buildout.cfg:
urls =
It made a small tarbomb and put itself inside a directory structure like:
And Zope was not be able to find it.

Buildout to the rescue again. Radim Novotny has made a buildout recipe for doing it right:
So all I needed was a few additions to the buildout.cfg

parts =
recipe = cns.recipe.zmysqlda
target = ${buildout:directory}/products

And then I was good to go.

2 kommentarer:

thisfred sagde ...


thanks for this writeup, which was exactly what I was looking for. One thing I can't figure out though: for me Zope doesn't start because (line 155) is looking for an image in a Zope folder that presumably in buildout lives somewhere else. Did you not run into this problem? I guess not, or you would have mentioned, huh? :)

I guess somehow my buildout recipe puts things in different places...

thisfred sagde ...

Never mind, found it: ZMySQLDa isn't ready for Zope 2.11 yet.

Fiddle fix:

change line 96:

from ImageFile import ImageFile


from App.ImageFile import ImageFile

(found here: