[cairo] PyCairo on Mac OS X
blake at hailmail.net
Sun Apr 18 14:31:01 PDT 2010
Did you accidentally name some python file 'cairo.py' that is also on
your import path?
To confirm that '>>> import cairo' is really getting the pycairo
module find the path to it:
and make sure that points to the right thing (a cairo directory with
an __init__.py and _cairo.so file within it).
On Apr 17, 2010, at 3:54 PM, Elver Loho wrote:
> I'm trying to install PyCairo on Mac OS X. Or, rather, I've done it.
> But it doesn't work.
> I've installed Cairo with Mac Ports. I've installed PyCairo with
> This is what happens when I try to use it:
> YellowTracksuit:~ elver$ python
> Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51)
> [GCC 4.2.1 (Apple Inc. build 5646)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import cairo
> ['__builtins__', '__doc__', '__file__', '__loader__', '__name__',
> '__package__', '__path__']
>>>> surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 256, 256)
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> AttributeError: 'module' object has no attribute 'ImageSurface'
> There be nothing there! What could be wrong and how do I fix it?
> elver.loho at gmail.com
> +372 5661 6933
> skype: elver.loho
> cairo mailing list
> cairo at cairographics.org
More information about the cairo