[Pythonmac-SIG] py2app: how to force packages into application bundle?

Joe Losco joelosco at frontiernet.net
Wed Sep 17 00:33:32 CEST 2008


Hey thats great.  Glad I could be of service.

Odd that the packages line broke it in the end.

Joe

On Sep 16, 2008, at 6:27 PM, weddingmusic at partybombe.de wrote:

> Hi Joe,
>
> i got it now!
> thank's alot for your help!!!
>
> since my python installation is still quite fresh, i removed it  
> completely and installed again.
> this time using Martin Ott's Subversion package 1.4.4 for checking  
> out development versions of modules.
> so i have the packages as you advised to me.
> and i had to remove packages=['mechanize'] from setup.py because it  
> causes the error: ImportError: No module named mechanize! Strange,  
> but that does not bother me in the moment.
> without this line building the application bundle works great!
>
> so, i'm happy now and can start writing some lines of code...
>
> greetings
> axel
>
> -------- Original-Nachricht --------
>> Datum: Tue, 16 Sep 2008 11:53:56 -0400
>> Von: Joe Losco <joelosco at frontiernet.net>
>> An: weddingmusic at partybombe.de
>> CC: pythonmac-sig at python.org
>> Betreff: Re: [Pythonmac-SIG] py2app: how to force packages into  
>> application bundle?
>
>>
>> On Sep 16, 2008, at 11:15 AM, weddingmusic at partybombe.de wrote:
>>>
>>> 1)
>>> easy_install -U somemodule==dev
>>> run into
>>> NameError: global name 'log' is not defined
>>>
>>> searching the web i figured out that this is a problem of subversion
>>> 1.5 and setuptools.
>>>
>>> at least i could fix this by checkout current setuptools-dev  
>>> manually:
>>> svn checkout http://svn.python.org/projects/sandbox/trunk/setuptools
>>> and installing by
>>> python setup.py install
>>
>> Hmm.. thats strange.  I wonder why I did not run into the bug.  I  
>> have
>> setuptools-0.6c8-py2.5.egg installed only.  I do not have
>> setuptools-0.7 installed.  I have subversion installed through
>> Macports.. ahh.. I have version 1.4.6 of subversion installed.  That
>> must be why.
>>
>>> 2)
>>> now i could install current development version of py2app,
>>> modulegraph and macholib as you suggested.
>>> my third party dictionary (/Library/Frameworks/Python.framework/
>>> Versions/2.5/lib/python2.5/site-packages ) looks like this now:
>>>
>>> ClientForm-0.2.9-py2.5.egg
>>> altgraph-0.6.7-py2.5.egg
>>> bdist_mpkg-0.4.3-py2.5.egg
>>> easy-install.pth
>>> macholib-1.1-py2.5.egg
>>> macholib-1.2.1.dev_r23-py2.5.egg
>>> mechanize-0.1.8-py2.5.egg
>>> modulegraph-0.7-py2.5.egg
>>> modulegraph-0.7.2.dev_r21-py2.5.egg
>>> py2app-0.3.6-py2.5.egg
>>> py2app-0.4.2-py2.5.egg
>>> setuptools-0.6c8-py2.5.egg
>>> setuptools-0.7a1dev_r66388-py2.5.egg
>>> setuptools.pth
>>>
>>> I'm not quite sure whether i should remove the old packages when
>>> installing new ones?
>>
>> It won't hurt taking the old ones out, but most likely you will need
>> to check the contents of the easy-install.pth so that it does not
>> reference old files that no longer exist.
>>
>>
>>> 3)
>>> running python setup.py py2app returns some new error now:
>>>
>>> running py2app
>>> Traceback (most recent call last):
>>> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
>>> python2.5/site-packages/py2app-0.4.2-py2.5.egg/py2app/build_app.py",
>>> line 579, in _run
>>>   self.run_normal()
>>> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
>>> python2.5/site-packages/py2app-0.4.2-py2.5.egg/py2app/build_app.py",
>>> line 631, in run_normal
>>>   mf = self.get_modulefinder()
>>> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
>>> python2.5/site-packages/py2app-0.4.2-py2.5.egg/py2app/build_app.py",
>>> line 539, in get_modulefinder
>>>   debug=debug,
>>> File "build/bdist.macosx-10.3-i386/egg/modulegraph/
>>> find_modules.py", line 255, in find_modules
>>>   find_needed_modules(mf, scripts, includes, packages)
>>> File "build/bdist.macosx-10.3-i386/egg/modulegraph/
>>> find_modules.py", line 176, in find_needed_modules
>>>   mf.run_script(path)
>>> File "build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py",
>>> line 369, in run_script
>>>   self.scan_code(co, m)
>>> File "build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py",
>>> line 638, in scan_code
>>>   self.scan_code(c, m)
>>> File "build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py",
>>> line 610, in scan_code
>>>   self._safe_import_hook(name, m, fromlist)
>>> File "build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py",
>>> line 540, in _safe_import_hook
>>>   mods = self.import_hook(name, caller)
>>> File "build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py",
>>> line 380, in import_hook
>>>   q, tail = self.find_head_package(parent, name)
>>> File "build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py",
>>> line 419, in find_head_package
>>>   q = self.import_module(head, qname, parent)
>>> File "build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py",
>>> line 493, in import_module
>>>   parent and parent.packagepath, parent)
>>> File "build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py",
>>> line 680, in find_module
>>>   fp, buf, stuff = find_module(name, path)
>>> File "build/bdist.macosx-10.3-i386/egg/modulegraph/modulegraph.py",
>>> line 114, in find_module
>>>   if isinstance(importer, pkg_resources.ImpWrapper):
>>> AttributeError: 'module' object has no attribute 'ImpWrapper'
>>>> /Users/me/python_test/build/bdist.macosx-10.3-i386/egg/modulegraph/
>>>> modulegraph.py(114)find_module()
>>> (Pdb)
>>>
>>> Anyone has got ideas?
>>> thank you
>>> axel
>>>
>>
>> well.. I checked your versions of macholib, modulegraph, and py2app
>> and I have the same.. the only item I do not have is the newer  
>> version
>> of setuptools.  Unfortunately I'm stumped now without looking into it
>> farther.
>> The only other difference I see is my setup.py from my old program  
>> has
>>
>> from distutils.core import setup not from setuptools import setup
>>
>> other than that I'm not sure why its not working as your program is
>> not complicated in any means.
>>
>> Best of luck and if you find out any other information, let me know.
>> Joe
>
> -- 
> GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
> Jetzt dabei sein: http://www.shortview.de/wasistshortview.php?mc=sv_ext_mf@gmx
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG at python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig
>



More information about the Pythonmac-SIG mailing list