[Pythonmac-SIG] py2app and PythonCard

Bob Ippolito bob at redivi.com
Mon Oct 25 19:16:46 CEST 2004


On Oct 25, 2004, at 12:44, Chris Barker wrote:

> Bob Ippolito wrote:
>> On Oct 25, 2004, at 12:21, Chris Barker wrote:
>>> Bob Ippolito wrote:
>>>> This is sort of a bug in py2app.  You are using software that uses 
>>>> PIL,  but you do not have PIL installed.
>>>
>>> Huh? does py2app use PIL? why?
>> No.  His software uses PIL (indirectly via PythonCard, it seems), 
>> py2app detected this and tried to include PIL, but PIL was not 
>> present.  svn trunk has been changed such that now py2app only tries 
>> to use recipes for packages that are actually present (a change to 
>> the recipes, not anything in py2app's core).
>
> Ah, I see. So this is really the same problem we can get with packages 
> that conditionally import stuff. If you're not using it, Py2app 
> doesn't know that. In fact, PIL is (or was, last I checked), whenever 
> I've tried to Py2exe an app that uses PIL, I get all if tkinter too, 
> even though I wasn't using it. It sounds like you're solving at least 
> half the problem.

If you py2exe an app that uses PIL you'll probably have an application 
that doesn't work.  One of the things that makes py2app more generally 
useful than py2exe is that it includes special exceptions, called 
recipes, that allow additional things to happen when certain packages 
are detected.  In cases like PIL or docutils, plugins need to be 
detected and added to the zip, or else they won't work.  py2app 
includes recipes that do these things.  Also, in PIL, it eliminates the 
implicit dependency on Tkinter (by means of FixTk), so if you don't use 
Tkinter elsewhere, then it won't be included.

py2app includes everything it sees, even if you don't think you're 
using it.  If you know you're not using a particular module or package, 
and you see that it is getting included anyway, then simply exclude it 
explicitly.  It's not very hard to do.  I would say that a whole lot 
more than half the problem is solved by py2app.

-bob



More information about the Pythonmac-SIG mailing list