[Pythonmac-SIG] Py2app/modulegraph crashes on pkg_resources

David Eyk eykd at eykd.net
Fri Oct 17 20:55:35 CEST 2008


My apologies to Chris Barker--I accidentally took this discussion off
the list, too. A common newbie mistake, it appears? His advice fixed
my initial issue, but py2app is still failing mysteriously on me,  now
for different reasons. I've reconstructed the pertinent bits of my
further problem below:

On Thu, Oct 16, 2008 at 3:11 PM, Christopher Barker
<Chris.Barker at noaa.gov> wrote:
>> David Eyk wrote:
>>
>> That got me halfway there! Let me briefly plug zc.buildout here: I've
>> been using it on all my projects since PyCon, and it made these tweaks
>> quite easy to implement, with a few changes to my buildout.cfg and
>> setup.py.

>> On to further problems, now: py2app builds about half of my app
>> package, but fails with the following message:
>>
>>    /Users/deyk/code/py/spaaace/trunk/dist/bash.app/Contents/MacOS/bash
>>    malformed object (unknown load command 8)
>>    stripping saved 18312668 bytes (12069072 / 30381740)
> That may be a warning, rather than an error -- did you try running the app?

I did.  Here's the console output:

>>>>
 kernel          : INFO     Starting up.
 kernel          : ERROR    AUGGH!!!! Run in circles! Scream and shout!
 Traceback (most recent call last):
  File "kernel.pyo", line 106, in main
  File "kernel.pyo", line 38, in initView
  File "bash/view.pyo", line 43, in <module>
 ImportError: cannot import name space
 root            : ERROR      File "kernel.pyo", line 106, in main
  File "kernel.pyo", line 38, in initView
  File "bash/view.pyo", line 43, in <module>

 root            : ERROR    ImportError: cannot import name space
 root            : ERROR    Entering debugger post-mortem:
 /Users/deyk/code/py/spaaace/trunk/dist/bash.app/Contents/Resources/bash/view.pyo(43)<module>()
 (Pdb)
 kernel          : INFO     Main: Finished.
 <<<<<

 Interestingly:

 $ ls /Users/deyk/code/py/spaaace/trunk/dist/bash.app/Contents/Resources/
 PythonApplet.icns       __boot__.py             data/     lib/
            site.pyc
 Spaaace.py              __error__.sh            include/
  site.py*

 No kernel.pyo, and no bash package actually exist inside the app
bundle. I see them in
"build/bdist.macosx-10.3-fat/python2.5-standalone/app/collect/", but
nowhere else. The run-time error is the same when I move the app
somewhere else and run it. It seems to still be importing them out of
the build tree, and pretending they're in the bundle tree. Weird!

The module that it's trying to import, space.py, isn't in the build
tree. This may be the source of my trouble, as the build-time error
was complaining about the bash package which contains space.py, so
I'll look into it. Still, everything runs and imports trouble-free in
the development environment. Weird!

I tried attaching py2app's console output, but it was too big for the
mailing list. If you're interested in perusing it, you'll find it at
http://eykd.net/pub/py2app-output.txt

> I also thought that was fixed (a similar issue was) in the latest macholib
> -- did you update that too?

I believe so. I have 1.2 installed.

> This may be a problem that comes a goes, too -- make sure you delete "build"
> and "dist" and try again.

Nope. Consistently fails.

Thanks for your help in puzzling this out.

David


More information about the Pythonmac-SIG mailing list