[Pythonmac-SIG] I have a small python application that works fine on a pc and under the interpreter on a mac running

Bob Ippolito bob at redivi.com
Mon Dec 8 15:39:15 EST 2003


On Dec 8, 2003, at 3:08 PM, RANDY BURNS wrote:

> I have a small python application that works fine on a pc and under 
> the interpreter on a mac running OSX panther
>  
> I'm attempting to package this  as per the instructions here:
> http://www.python.org/cgi-bin/moinmoin/BundleBuilder
>  
> I think the problem may be that I'm not specifying all the 
> binary libraries needed
> I'd really appreciate a pointer here.

What you're showing here are bundlebuilder warnings, not errors.  
--standalone or --semi-standalone will almost always generate warnings 
because modulefinder tends to guess wrong, so this is expected 
behavior.   It analyzes parse trees if Python code without executing 
it, so it can't always be correct due to the dynamic nature of Python.  
So in effect, your email doesn't actually state a problem.

However, it is entirely possible (and probably likely) that you are 
missing modules, so the app bundle you have built might not work.  The 
best way I've found to determine this is to run the application and 
look at the console output to determine which import caused a 
traceback.  Another quick way to determine the modules that it needs is 
to have it dump sys.modules.keys() to the on exit, and you can compare 
the two (the working interpreter version, and the non-working 
standalone version) to see which modules/packages you need to add.  
This, of course, is only good if running your app causes it to load all 
of the modules it will use, but that's typical behavior for most 
applications (early import vs. late import).  There is also a potential 
that you are missing dylib or framework libraries, which is a much more 
difficult issue to resolve (until I release my mach-o walking version 
of bundlebuilder) but will manifest itself as a dyld error and may tell 
you which file it's missing.  If not, you'll have to otool -Lv 
somePythonExtension.so and look at the load commands to see which 
non-/System and non-/usr/lib files it links to.  An example would be 
what you've done to include the wxWindows dylibs.

It is also worthy of mention that --standalone is worthless for Python 
2.3 on OS X 10.3, and you should be using --semi-standalone instead.  
This is because the executable produced is only compatible with OS X 
10.3 (it is NOT backwards compatible to 10.2).  Everyone currently 
capable of running your app (10.3 users) will already have the correct 
installation of Python, so --standalone is just unnecessary bloat.

BTW, your bundlebuilder script might be clearer if you used the typical 
conventions (using kwargs of bundlebuilder.buildapp()) or at least 
changed the multiple calls to someList.append(...) to a single 
someList.extend([....]).

-bob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2357 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20031208/8c60efbf/smime.bin


More information about the Pythonmac-SIG mailing list