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

Joe Losco joelosco at frontiernet.net
Tue Sep 16 15:18:03 CEST 2008



> thanks Joe,

no problem.. glad I could help..

> gets me the following output:
> running py2app
> Traceback (most recent call last):
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
> python2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/build_app.py",  
> line 548, in _run
>   self.run_normal()
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
> python2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/build_app.py",  
> line 600, in run_normal
>   mf = self.get_modulefinder()
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
> python2.5/site-packages/py2app-0.3.6-py2.5.egg/py2app/build_app.py",  
> line 508, in get_modulefinder
>   debug=debug,
> File "build/bdist.macosx-10.3-i386/egg/modulegraph/find_modules.py",  
> line 243, in find_modules
>   find_needed_modules(mf, scripts, includes, packages)
> File "build/bdist.macosx-10.3-i386/egg/modulegraph/find_modules.py",  
> line 179, in find_needed_modules
>   path = m.packagepath[0]
> TypeError: 'NoneType' object is unsubscriptable
>> /Users/me/python_test/build/bdist.macosx-10.3-i386/egg/modulegraph/ 
>> find_modules.py(179)find_needed_modules()
> (Pdb)

ok.. next I think you have run into an issues with the versions of  
modulegraph and py2app.
I ran into the same issue.  I had to easy_install -U modulegraph==dev  
and easy_install -U py2app==dev to fix it.  oh and I also had to  
easy_install -U macholib==dev  since thats a dependancy.\
However I should note that there are risks using the development  
versions of the packages because there are going to be bugs and they  
are updated nightly I believe.  So there may be bugs that weren't  
there when I downloaded it and there may be bugs I have that are fixed  
now.  Hopefully they get pushed up to the stable soon so that people  
don't have to use the development versions.


> please allow some more questions:
> 1) is it correct that there is a directory "build/bdist.macosx-10.3- 
> i386"? (I'm running macosx 10.4.11)
> 2) i want to use python 2.5.2 which i installed in "/Library/ 
> Frameworks/Python.framework/Versions/2.5"
> i do not want to use the system installed python 2.3.5 in "/System/ 
> Library/Frameworks/Python.framework/Versions/2.3"
> is it correct to set PYTHONPATH to "/Library/Frameworks/ 
> Python.framework/Versions/2.5" in ~/.MacOSX/environment.plist ?
> does the first line in my setup.py probably refere to a wrong  
> python2.3?
> 3) did i install the mechanize package correct, when i find the file  
> "mechanize-0.1.8-py2.5.egg" in "/Library/Frameworks/Python.framework/ 
> Versions/2.5/lib/python2.5/site-packages"?
>
> hope to get some more help
> greets
> axel
>

I'll do my best here however I'm not extremely experienced, I just  
happened to run into the same issues you did.
1) I believe thats ok, because I think its just been hard coded into  
py2app by its developer as to how the build directory gets made.
2) from the terminal do a 'which python' and make sure that the  
desired python is displayed.  I believe the python used to run py2app  
is the selected one that shows in the which.
	I don't think its necessary to set pythonpath in that plist.  In  
my .bash_profile file in my home directory I set up my $PATH so that  
the desired python is found first.. therefore shown in which.  I think  
thats all thats needed.
3) Yes thats the systemwide location for the mechanize package.  You  
could have also put it in ~/Library/Python/2.5/site-packages/.

best of luck
joe

ps you should keep posting to the group as well so that others can  
benefit from our discussion or contribute ideas / corrections where I  
may be wrong or not know.

	


More information about the Pythonmac-SIG mailing list