[Pythonmac-SIG] Embedding MacPython in Matlab via mex file

Barry Wark barrywark at gmail.com
Sun Nov 20 08:27:24 CET 2005


Hello all,

I realize that this question cuts across quite a few areas. I hope
folks around here can help me, but would be happy for direction to a
better forum if one exists...

I'm trying to embed the MacPython (Python.framework in OS X 10.4) in
Matlab via a Matlab mex file (essentially a dylib that Matlab loads).
The python code that I want to execute uses PyObjC. In my Xcode
project for the mex file, I link only against the Python.framework.

When Matlab tries to load the module that contains my code, I get the
following error:

 Unable to load module:
dlopen(/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/PyObjC/objc/_objc.so,
2): Symbol not found: __cg_TIFFWriteDirectory
  Referenced from:
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /Applications/MATLAB/bin/mac/libTIFF.dylib


Importing my module in the python interpreter is no problem. My
interpretation is that there's a conflict between the OS X frameworks
and Matlab's libTIFF over who implements what. Can anyone suggest a
solution?

Again, I'd be happy for a pointer towards a more appropriate forum if
this isn't it.

Thanks!
Barry


More information about the Pythonmac-SIG mailing list