I am trying to install py2cairo on a framework build (Mac OSX Lion) of python 2.7.3 using brew. I have been unsuccessful this far.
First, I tried a simple
brew install py2cairo
This seems to work only on a non-framework build of python. When I do this on my framework build python faults as soon as I import cairo with an incompatible binary error.
Second, I have tried to build it myself by grabbing it from github and issuing:
python waf configure
This fails with:
Checking for library python2.7 : not found
Checking for library python2.7 : not found
Checking for library python2.7 : not found
Checking for library python27 : not found
Checking for program python2.7-config : /usr/local/Cellar/python/2.7.3/bin/python2.7- config
Checking for header Python.h : Could not find the python development headers
The configuration failed
(complete log in /Users/tobin/tmp/py2cairo/build_directory/config.log)
I have tried everything at: How to install PyCairo 1.10 on Mac OSX with default python but none of this has helped.
It appears to me that this may be failing to find python2.7 library and header file since it is a framework build. Is that possible? I was looking at the brew formula and it appears that framework builds do not get --enable-share set at build time. I'm not sure if that is relevant here - but maybe one possibility.
Anyone other insights would be great. Thanks in advance.
UPDATE:
I discovered that the inability to build py2cairo had to do with the use of the "-march=native" flag by gcc. gcc (4.2.1) on Mac OSX has issues with this. I then reinstalled gcc as well as python. Afterwards when building py2cairo with waf - it was getting "-march=core2" and everything built.
Unfortunately, not all is good yet. I get the same error when I import cairo from my build that I got from the brew version (as mentioned above). The exact error message is:
>>> import cairo
Fatal Python error: Interpreter not initialized (version mismatch?)
Abort trap: 6
and then python exits.
It would now seem that the issue is related to the framework build of python. I tested it without a framework build and it worked fine.