[Pythonmac-SIG] py2app: calling from Matlab and DYLD path problem

Hamid M. spam.wax at gmail.com
Wed Jul 6 01:58:55 CEST 2011

Hello everyone

I used py2app on a script that uses Qt and VTK libraries.
For this to work, I had to edit __boot__.py within bundle to manually insert
Contents/Resources/lib/python2.6/lib-dynload to 'sys' path, otherwise
the application
would complain that it couldn't find one of the .dyld files although
it was in 'lib-dynload' folder!
(I followed the tutorial and I didn't modify setup.py at all)

I can now launch and use the application.
However when I call this application from within Matlab using 'system'
calls, it seems that the
executable falls back on using the dynamic libraries that comes with
Matlab rather than using the ones
in bundle!
So I tried to unset the DYLD_LIBRARY_PATH variable before calling my
app in order to remove
Matlab's library paths, and that didn't help.

I have tried calling my application using both of these from Matlab
command prompt:

>> system('unset DYLD_LIBRARY_PATH; open -a /path/to/nirviz.app')


>> system('unset DYLD_LIBRARY_PATH; /path/to/nirviz.app/Contents/MacOS/nirviz')

I was wondering if you guys could help me with this, any hint is appreciated.

thanks in advance,
Hamid G

More information about the Pythonmac-SIG mailing list