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

Terry Jones tcj25 at cam.ac.uk
Fri Oct 14 20:03:43 CEST 2005


Hi Bob

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

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?

Anyway, it does seem that you've solved my problem, thank you. I should
have gone back to the Qt installation instructions on my own. Now to see if
someone else can open my app.

I have another question coming up :-)

Regards,
Terry.


More information about the Pythonmac-SIG mailing list