[Pythonmac-SIG] Semi-standalone Qt py2app can't find qt.so

Ivan Vilata i Balaguer ivilata at carabos.com
Fri Jul 20 20:43:26 CEST 2007


Hi people,

I'm attaching an utterly trivial project (the hello world example from
the PyQt tutorial) which shows that py2app-generated *semi-standalone*
apps using Qt fail to run, apparently because of the path to the Qt libs
included in the appdir not being placed in ``sys.path``.

To check this yourselves, simply place ``MyApp.py`` and ``setup.py`` in
the same directory, run ``python setup.py py2app`` and try to open the
resulting app bundle which is left in the ``dist`` directory with Finder.


This is the error dialog that I get::

    MyApp Error

    MyApp Error
    An unexpected error has occurred during execution of the main script

    ImportError: '/Library/Frameworks/Python.framework/Versions/2.5/lib/
    python2.5/lib-dynload/qt.so' not found

And these are the console messages::

    Traceback (most recent call last):
      File "/Users/ivan/MyApp/dist/MyApp.app/Contents/Resources/__boot__.py",
      line 31, in <module>
        _run('MyApp.py')
      File "/Users/ivan/MyApp/dist/MyApp.app/Contents/Resources/__boot__.py",
      line 28, in _run
        execfile(path, globals(), globals())
      File "/Users/ivan/MyApp/dist/MyApp.app/Contents/Resources/MyApp.py",
      line 6, in <module>
        import qt
      File "qt.pyc", line 18, in <module>
      File "qt.pyc", line 15, in __load
    ImportError: '/Library/Frameworks/Python.framework/Versions/2.5/lib/
    python2.5/lib-dynload/qt.so' not found
    2007-07-20 20:11:48.233 MyApp[286] MyApp Error
    2007-07-20 20:11:48.235 MyApp[286] MyApp Error
    An unexpected error has occurred during execution of the main script
    
    ImportError: '/Library/Frameworks/Python.framework/Versions/2.5/lib/
    python2.5/lib-dynload/qt.so' not found


Please note how the app is trying to load ``qt.so`` *from the system*
instead of from the appdir.  Running ``python MyApp.py`` works fine.

I'm using Universal MacPython 2.5, PyQt 3.17 and py2app 0.3.6.

::

	Ivan Vilata i Balaguer   >qo<   http://www.carabos.com/
	       Cárabos Coop. V.  V  V   Enjoy Data
	                          ""
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MyApp.py
Type: text/x-python
Size: 223 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20070720/26f2e8d4/attachment.py 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setup.py
Type: text/x-python
Size: 151 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20070720/26f2e8d4/attachment-0001.py 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: Digital signature
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20070720/26f2e8d4/attachment.pgp 


More information about the Pythonmac-SIG mailing list