[Pythonmac-SIG] py2app warning: may need to include email.Util

Russell E. Owen rowen at cesmail.net
Mon Aug 6 22:15:19 CEST 2007


In article <4EEDBEBC-421B-401A-B511-BB526F129022 at rochester.rr.com>,
 Benjamin Schollnick <junkster at rochester.rr.com> wrote:

> Sorry for jumping in so late....
> 
> >>> My py2app-bundled Mac application recently started failing with "no
> >>> module named email.Util" when trying to display images. It turns out
> >>> pyfits uses urllib which uses email.Util, which apparently has been
> >>> renamed email.util with some kind of clever lazy import code so  
> >>> one can
> >>> still use email.Util. Apparently the cleverness is too much for  
> >>> py2app's
> >>> module finder.
> >
> > I submitted a patch for python (changing email.Utils->email.utils in
> > urllib, with similar patches for urllib2 and smtplib). But I agree
> > that a recipe for py2app would be very good, since some people will
> > run py2app against 2.5.
> >
> > The following recipe seems to work, but I don't know if it's really
> > the right way to go. It is based on extrapolating from the current
> > recipes. None of them seem to do the same job and I've not found any
> > docs on writing recipes:
> 
> I hate to say this, but I don't see *HOW* to use the recipes.....
> 
> I'm running into the email issue, as well as not seeing sndhdr....
> 
> And I can't seem to find easy solution....
> 
> Can anyone point me towards a method to use py2app recipes?

I suggest you try to fix the problem by supplying addition information 
to the setup function in your setup.py script. I often end up using the 
"packages" and "data_files" arguments. I don't recall all the others, 
but you can run py2app asking for help to see a list of command line 
arguments, most or all of which can be supplied as arguments to the 
setup function.

I don't think recipes are going to help you -- at least not yet.

Recipes are a very convenient way to tell py2app how to handle certain 
common situations. The recipe contains information about when it should 
be used and py2app automatically uses the one that match. As py2app 
runs, it tells you which recipes it is using.

So once you figure out what additional info py2app needs for your 
particular situation you can then write a recipe to handle it and submit 
it to the py2app project. But I found that tricky for the case you 
quoted because of the lack of documentation on writing recipes.

-- Russell



More information about the Pythonmac-SIG mailing list