Compiling pycairo on Leopard
I’ve just been trying to build pycairo, the Python wrappers for the Cairo graphics library on Mac OS X 10.5 Leopard. Unfortunately, the 1.4.0 tarball for pycairo doesn’t work out the box. It’ll compile, but when you try and use it you get the following error:
>>> import cairo
Traceback (most recent call last): File “
ImportError: dlopen(/Library/Python/2.5/site-packages/cairo/_cairo.so, 2): Symbol not found: _PycairoContext_FromContext
Referenced from: /Library/Python/2.5/site-packages/cairo/_cairo.so
Expected in: flat namespace
The problem is that as part of the build process all but one symbol in the _cairo.so file are made private using nmedit. To stop the nmedit stage from working I changed the cairo/Makefile.in file, making like 207 look like this:
_cairo_la_LDFLAGS = -module -avoid-version
Essentially removing the ”-export-symbols-regex init_cairo” that’s in the file originally. Then the symbols are still active and things should work. Now everything should be okay to use the cairo library under Python.
I’ll file this under their bugzilla, but I just thought I’d document this somewhere that Google might make note in case anyone else has this problem before it’s fixed at source :)
- Next: Negative numeracy
- Previous: Skype phone
- Tags: Geek