Just another update on my travails with making an app build with py2app. Since my previous posts haven&#39;t attracted much attention, I&#39;m primarily posting this on the off-chance that someone else is having similar issues and might be helped. However, please do speak up if you have something to contribute! I&#39;m starting to get a wee bit frustrated.<br>
<br>Things I have discovered (some of this is a recap):<br><br>To build with a nonstandard Python install (necessary to get py2app to include the Python interpreter in the build), I have to &quot;create&quot; a main-i386 app template. This is done by going into py2app-0.5.2-py2.5.egg/py2app/apptemplate/prebuilt and doing &quot;ln -sf main-fat3 main-i386&quot;<br>
<br>This will allow py2app to build the app. However, it won&#39;t run, because I have a dependency on a .so file which isn&#39;t in the default search paths that py2app sets up. So I have to modify __boot__.py by adding this line to the run() function right after it imports sys:<br>
sys.path.insert(0, os.path.join(os.getcwd(), &#39;lib&#39;, &#39;python2.5&#39;, &#39;lib-dynload&#39;))<br><br>That code actually isn&#39;t reachable yet, though (I know I have to fix it because my previous nominally-successful builds weren&#39;t standalone and thus made it further). Instead, I get this error when __boot__.py&#39;s _chdir_resource() function tries to import the os module:<br>
zipimport.ZipImportError: can&#39;t decompress data; zlib not available <br><br>zlib is present:<br>% find dist -name &quot;zlib*&quot;<br>dist/processor.app/Contents/Resources/lib/python2.5/lib-dynload/zlib.so<br><br>However, it&#39;s clearly not in the search path at this point -- and the program can&#39;t import os to change its search path! I can find a copy of os.py from my /Library/Frameworks and insert it at the same level as __boot__.py, and it will find that -- then fail to load posixpath with the same zlib error (and then stat when I add posixpath, etc.). If I manually uncompress lib/python2.5/site-packages.zip and copy eveyrthing in it (including directories) down two levels to the Resources directory, then everything seems to go fine until my app tries to import wx, at which point this happens:<br>
<br>ImportError: dlopen(/Users/chriswei/proj/ucsf/bitbucket-repo/processor/dist/processor.app/Contents/Resources/lib/python2.5/lib-dynload/wx/_core_.so, 2): no suitable image found.  Did find: <br>/Users/chriswei/proj/ucsf/bitbucket-repo/processor/dist/processor.app/Contents/Resources/lib/python2.5/lib-dynload/wx/_core_.so: no matching architecture in universal wrapper <br>
<br>And that&#39;s where I&#39;m stuck now. I&#39;ve found shreds and snippets of similar-sounding problems from other users, but no indication of what fixed things for them. The py2app trac site is down -- is it even supported any more? If not, what&#39;s the plan for standalone Python programs on OSX going forward? <br>
<br>-Chris<br>