Re: [Pythonmac-SIG] problem running py2app
On 2/2/10 6:24 PM, William R.Dickson wrote: Attila Tajtiattila.tajtiat gmail.com writes: error: unpack requires a string argument of length 8 /Users/ata/Projects/MailArchiveButton/build/bdist.macosx-10.6- universal/egg/macholib/ptypes.py(48)from_str() (Pdb) ^D I'm getting the same error on my first attempt to build an app. Did you get any response to this question? Thanks, -Bill http://wiki.python.org/moin/MacPython/BundleBuilder -- Kevin Walzer Code by Kevin http://www.codebykevin.com ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] problem running py2app
On 2010.02.03., at 0:24, William R. Dickson wrote: error: unpack requires a string argument of length 8 /Users/ata/Projects/MailArchiveButton/build/bdist.macosx-10.6- universal/egg/macholib/ptypes.py(48)from_str() (Pdb) ^D I'm getting the same error on my first attempt to build an app. Did you get any response to this question? I had no response, nor had I any serious attempts to fix it yet. I suggest to take a look at the article by Virgil Drupas. I had no time to test his version of py2app yet. (This was also mentioned on this list earlier by Kevin Walzer.) http://www.hardcoded.net/articles/building-64-bit-pyobjc-applications-with-py2app.htm Honestly this article disappointed me because of the problems with both memory consumption and necessity to use a separate 10.5 partition for the build system, so I started looking for another project for the time being. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] problem running py2app
Hello, As my first Mac OS X project I am trying to build a sample plugin with py2app. I am following this tutorial: http://eaganj.free.fr/weblog/?post/2009/07/14/Demystifying-Mail.app-Plugins-on-Leopard I do not know what am I doing wrong, but I cannot seem to be able to create my plugin in the first place. python setup.py py2app -A works, but creating a standalong plugin fails. Do you know what is wrong? First I tried with py2app 0.4.3, but now I use svn trunk. python setup.py py2app output: running py2app *** using recipe: virtualenv *** *** filtering dependencies *** 369 total 366 filtered 0 orphaned 3 remaining *** create binaries *** *** byte compile python files *** skipping byte-compilation of /Users/ata/Projects/MailArchiveButton/MyPlugin.py to MyPlugin.pyc byte-compiling /Users/ata/Scrap/py2app/py2app/bootstrap/boot_plugin.py to boot_plugin.pyc byte-compiling /Users/ata/Scrap/py2app/py2app/bootstrap/disable_linecache.py to disable_linecache.pyc *** creating plugin bundle: MyPlugin *** copying MyPlugin.py - /Users/ata/Projects/MailArchiveButton/dist/MyPlugin.mailbundle/Contents/Resources creating /Users/ata/Projects/MailArchiveButton/dist/MyPlugin.mailbundle/Contents/Resources/lib creating /Users/ata/Projects/MailArchiveButton/dist/MyPlugin.mailbundle/Contents/Resources/lib/python2.6 copying build/bdist.macosx-10.6-universal/python2.6-semi_standalone/app/site-packages.zip - /Users/ata/Projects/MailArchiveButton/dist/MyPlugin.mailbundle/Contents/Resources/lib/python2.6 creating /Users/ata/Projects/MailArchiveButton/dist/MyPlugin.mailbundle/Contents/Resources/lib/python2.6/lib-dynload creating /Users/ata/Projects/MailArchiveButton/dist/MyPlugin.mailbundle/Contents/Frameworks Traceback (most recent call last): File /Users/ata/Scrap/py2app/py2app/build_app.py, line 589, in _run self.run_normal() File /Users/ata/Scrap/py2app/py2app/build_app.py, line 660, in run_normal self.create_binaries(py_files, pkgdirs, extensions, loader_files) File /Users/ata/Scrap/py2app/py2app/build_app.py, line 777, in create_binaries platfiles = mm.run() File build/bdist.macosx-10.6-universal/egg/macholib/MachOStandalone.py, line 101, in run for fn in platfiles: File build/bdist.macosx-10.6-universal/egg/macholib/util.py, line 227, in iter_platform_files if is_platform_file(fn): File build/bdist.macosx-10.6-universal/egg/macholib/util.py, line 206, in is_platform_file header = mach_o.fat_header.from_fileobj(fileobj, _endian_='') File build/bdist.macosx-10.6-universal/egg/macholib/ptypes.py, line 44, in from_fileobj return cls.from_str(f.read(cls._size_), **kw) File build/bdist.macosx-10.6-universal/egg/macholib/ptypes.py, line 48, in from_str return cls.from_tuple(struct.unpack(endian + cls._format_, s), **kw) error: unpack requires a string argument of length 8 /Users/ata/Projects/MailArchiveButton/build/bdist.macosx-10.6-universal/egg/macholib/ptypes.py(48)from_str() (Pdb) ^D setup.py: from distutils.core import setup import py2app plist = dict( NSPrincipalClass='MyPlugin', CFBundleVersion='1', SupportedPluginCompatibilityUUIDs=[ '225E0A48-2CDB-44A6-8D99-A9BB8AF6BA04', 'B3F3FC72-315D-4323-BE85-7AB76090224D', '2610F061-32C6-4C6B-B90A-7A3102F9B9C8', '99BB3782-6C16-4C6F-B910-25ED1C1CB38B', '2F0CF6F9-35BA-4812-9CB2-155C0FDB9B0F', '0CB5F2A0-A173-4809-86E3-9317261F1745' ] ) setup( plugin = ['MyPlugin.py'], options=dict(py2app=dict(extension='.mailbundle', plist=plist)) ) myplugin.py: from AppKit import * from Foundation import * import objc MVMailBundle = objc.lookUpClass('MVMailBundle') class MyPlugin(MVMailBundle): @classmethod def initialize (cls): cls.registerBundle() NSLog(MyPlugin registered with Mail) initialize = classmethod(initialize) -- Attila ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] problem running py2app bundle referencing PyLucene
Hey all, I'm a long-time python wrangler, but I've recently been doing more development for deployment on the Mac. I've been trying to get py2app to build a wrapper around a small Python server that uses PyLucene. Unfortunately, I've hit a few snags. When I build, I supply the following environment parameters to the location where I have the PyLucene.py, _PyLucene.so and required *dylib files. export DYLD_LIBRARY_PATH=~/Projects/dtsearch/lib export PYTHONPATH=~/Projects/dtsearch/lib; setup.py py2app seems to run without a problem and correctly tracks down the dependencies. However, when a I run a new terminal, without those environment variables, I get this spew: [msolomon]beast:~/Projects/dtsearch dist/dtserv.app/Contents/MacOS/ dtserv Traceback (most recent call last): File /Users/msolomon/Projects/dtsearch/dist/dtserv.app/Contents/ Resources/__boot__.py, line 137, in ? _run('dtserv.py') File /Users/msolomon/Projects/dtsearch/dist/dtserv.app/Contents/ Resources/__boot__.py, line 134, in _run execfile(path, globals(), globals()) File /Users/msolomon/Projects/dtsearch/dist/dtserv.app/Contents/ Resources/dtserv.py, line 17, in ? import dtsearch File dtsearch.pyc, line 10, in ? File search.pyc, line 7, in ? File PyLucene.pyc, line 33, in ? ImportError: Failure linking new module: /Users/msolomon/Projects/ dtsearch/dist/dtserv.app/Contents/Resources/lib/python2.4/lib-dynload/ _PyLucene.so: Library not loaded: /opt/local/lib/gcc41/libgcj.7.dylib Referenced from: /Users/msolomon/Projects/dtsearch/dist/dtserv.app/ Contents/Resources/lib/python2.4/lib-dynload/_PyLucene.so Reason: image not found 2007-01-01 20:07:06.127 dtserv[8407] dtserv Error 2007-01-01 20:07:06.130 dtserv[8407] dtserv Error An unexpected error has occurred during execution of the main script ImportError: Failure linking new module: /Users/msolomon/Projects/ dtsearch/dist/dtserv.app/Contents/Resources/lib/python2.4/lib-dynload/ _PyLucene.so: Library not loaded: /opt/local/lib/gcc41/libgcj.7.dylib Referenced from: /Users/msolomon/Projects/dtsearch/dist/dtserv.app/ Contents/Resources/lib/python2.4/lib-dynload/_PyLucene.so Reason: image not found Now, the _PyLucene.so want to link against these libs, none of which exists at these paths (nor have they ever, on my machine). /opt/local/lib/gcc41/libgcj.7.dylib (compatibility version 8.0.0, current version 8.0.0) /opt/local/lib/gcc41/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /opt/local/lib/gcc41/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.8.0) So, normally, I have to export they correct DYLD_LIBRARY_PATH, so I added those variables back in. Now I get this: [msolomon]beast:~/Projects/dtsearch dist/dtserv.app/Contents/MacOS/ dtserv Fatal Python error: Interpreter not initialized (version mismatch?) Abort trap I've spent several hours hunting through the bootstrap and a few other bits, but I didn't have a good intuitive feel for where the problem is. Is there something simple that I'm missing? Any help would be appreciated. Thanks, -Mike ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig