[Pythonmac-SIG] Still hitting ImportError when trying to open app made with py2app

Bob Ippolito bob at redivi.com
Fri Oct 14 20:12:11 CEST 2005


On Oct 14, 2005, at 11:03 AM, Terry Jones wrote:

> Thanks a lot for your answer and pointer.
>
> | Last I checked, Qt wasn't ported correctly to OS X; it requires some
> | extra crap to be set.  As part of the Qt directions you're required
> | to set DYLD_LIBRARY_PATH so that the linker and applications can  
> find
> | the Qt libraries.  Make sure that DYLD_LIBRARY_PATH (or whatever  
> they
> | recommend) set before you run py2app, or else it won't find those
> | dylibs.
>
> I already had DYLD_LIBRARY_PATH and QTDIR in my environment when  
> running
> py2app. But thinking about your comment, it occurred to me that  
> maybe these
> weren't set in the environment the app was seeing when invoked by the
> finder. So I added them both to my ~/.MacOS/environment.plist.
>
> This didn't help. But I did notice that when double-clicking on the
> application (after moving it to /Applications) in the finder caused  
> the
> finder window to crash.
>
> I went back to the INSTALL file for Mac Qt, and noticed that they  
> recommend
>
>     ln -sf $QTDIR/lib/libqt.3.dylib /usr/lib
>     ln -sf $QTDIR/lib/libqui.1.dylib /usr/lib

That's bad!  Don't do that, remove those links.  /usr/local/lib would  
be a lot better.  That will not build a redistributable application,  
py2app correctly assumes everything in system locations is a system  
component, so will not be included in any app created with the tool.

> So I did this and rebuilt via py2app. This does seem to work - the  
> libs get
> picked up and I can fire up the app in 3 ways (open via bash,  
> double click
> in finder, single click on icon in dock).
>
> One oddity that remains is that if I open a new finder window and  
> click
> once on Applications, and then once on the name of my app, the finder
> window crashes and the following appears in the Console:
>
> | 2005-10-14 19:52:59.181 Finder[1315] *** _NSAutoreleaseNoPool():  
> Object 0x6f6e30 of class NSCFString autoreleased with no pool in  
> place - just leaking
> | 2005-10-14 19:52:59.182 Finder[1315] *** -[NSCFNumber length]:  
> selector not recognized
> | 2005-10-14 19:52:59.182 Finder[1315] *** _NSAutoreleaseNoPool():  
> Object 0x5644db0 of class NSCFString autoreleased with no pool in  
> place - just leaking
> | 2005-10-14 19:52:59.182 Finder[1315] *** _NSAutoreleaseNoPool():  
> Object 0x5645d80 of class NSCFString autoreleased with no pool in  
> place - just leaking
> | 2005-10-14 19:52:59.182 Finder[1315] *** _NSAutoreleaseNoPool():  
> Object 0x5644e00 of class NSException autoreleased with no pool in  
> place - just leaking
> | 2005-10-14 19:52:59.182 Finder[1315] *** Uncaught exception:  
> <NSInvalidArgumentException> *** -[NSCFNumber length]: selector not  
> recognized
>
> Is this a known problem?

Qt is a known problem :)

-bob




More information about the Pythonmac-SIG mailing list