OSX application built with py2app can't see bundled PySide module?

Aaron Scott aaron.hildebrandt at gmail.com
Thu Sep 1 15:54:02 EDT 2011

I'm trying to deploy a Python app on OSX that was built with PySide. py2app packages it without issue, copying and linking a lot of PySide and Qt files in the process. But then, when I try to run the built app, I get this error:

Traceback (most recent call last):
  File "/Users/sequence/Desktop/code/dailies/dist/dailies_v02.app/Contents/Resources/__boot__.py", line 31, in <module>
  File "/Users/sequence/Desktop/code/dailies/dist/dailies_v02.app/Contents/Resources/__boot__.py", line 28, in _run
    execfile(path, globals(), globals())
  File "/Users/sequence/Desktop/code/dailies/dist/dailies_v02.app/Contents/Resources/dailies_v02.py", line 9, in <module>
from PySide.QtCore import *
  File "PySide/__init__.pyc", line 2, in <module>
  File "PySide/private.pyc", line 2, in <module>
  File "PySide/QtCore.pyc", line 18, in <module>
  File "PySide/QtCore.pyc", line 15, in __load
ImportError: '/usr/lib/python2.6/lib-dynload/PySide/QtCore.so' not found

The weird thing is, QtCore.so IS included in the application bundle: py2app copied it to the build under Contents/Resources/lib/python2.6/lib-dynload/PySide/. Is there a reason the application isn't seeing this?

More information about the Python-list mailing list