当我尝试使用 Python 2.7.2 在 OS X Lion 上安装 Cairo 时,它不起作用,我可以构建和安装它,但是在 python 中导入 cairo 时找不到它。我已经尝试了如何在 Mac OSX 上默认安装 PyCairo 1.10,它只会产生这个错误
"_cairo_xlib_surface_get_width", referenced from:
_xlib_surface_get_width in surface.c.1.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/l9/71rhp2vs7w34bm4x6mfwms500000gn/T//cc1fcO7s.out (No such file or directory)
Waf: Leaving directory `/Users/andrewlynch/Downloads/py2cairo-1.10.0/build_directory'
Build failed
-> task failed (exit status 1):
{task 4550820944: cshlib cairomodule.c.1.o,context.c.1.o,font.c.1.o,path.c.1.o,pattern.c.1.o,matrix.c.1.o,surface.c.1.o -> _cairo.so}
['/usr/bin/gcc', 'src/cairomodule.c.1.o', 'src/context.c.1.o', 'src/font.c.1.o', 'src/path.c.1.o', 'src/pattern.c.1.o', 'src/matrix.c.1.o', 'src/surface.c.1.o', '-o', '/Users/andrewlynch/Downloads/py2cairo-1.10.0/build_directory/src/_cairo.so', '-L/usr/local/Cellar/cairo/1.10.2/lib', '-lcairo', '-lpython2.7', '-dynamiclib', '-Wl,-F.', '-arch', 'i386', '-arch', 'x86_64', '-Wl,-F.', '-Wl,-F.', '-arch', 'i386', '-arch', 'x86_64', '-arch', 'i386', '-arch', 'x86_64']}