[Distutils] py2exe and eggs

Phillip J. Eby pje at telecommunity.com
Fri Aug 19 19:12:51 CEST 2005

At 12:40 PM 8/19/2005 -0400, Jay Parlar wrote:
>On 8/19/05, Phillip J. Eby <pje at telecommunity.com> wrote:
> > I guess I'll add it to my list to see if I can create a py2exe wrapper for
> > setuptools.  Or, since Thomas is now playing with setuptools also, perhaps
> > he, Kevin, and I can work something out to make py2exe work as a setuptools
> > extension.  Since setuptools provides hooks for such extensions to add
> > setup() keywords and new commands, maybe we can get py2exe hooked in such
> > that it just adds the required eggs to the zipfile in "basket" mode, and
> > doesn't bother tracking imports to packages found in eggs.  (Except maybe
> > for pkg_resources, which it should just always include in the zipfile.)
>Well, the issue I just ran into was that the 'symbol' package wasn't
>being brought in by py2exe, because the only place it was imported was
>in RuleDispatch (or maybe PyProtocols, can't remember).

Did you have those packages (RuleDispatch & PyProtocols) installed in 
site-packages and easy_install.pth?  If not, they wouldn't be on sys.path, 
so I doubt py2exe would be able to find them.  You might need to add them 
to "setup_requires" to work with py2exe.  (Also, you should be importing 
py2exe *after* importing setuptools, and you should be using the CVS 
version of setuptools.)

If py2exe *still* can't find "symbol", I don't know what to tell you.

Makes me wonder if I should have setuptools create some kind of "stdlib 
imports" metadata file for eggs, so that it wouldn't be necessary to scan 
an egg to find its imports.  But that's a bit further down the road, maybe 
when I'm adding support for "legacy" dependencies.

More information about the Distutils-SIG mailing list