[Distutils] py2exe and eggs

Jay Parlar parlar at gmail.com
Tue Aug 16 19:10:28 CEST 2005

Hmm... Even with eggs.pth in the resulting 'dist' directory, my
sys.path still doesn't show the eggs on it. Is there something you
have to do with py2exe to make it look for .pth files?

Jay P.

On 8/16/05, Kevin Dangoor <dangoor at gmail.com> wrote:
> On 8/16/05, Jay Parlar <parlar at gmail.com> wrote:
> > I followed the steps, but I believe I'm missing something basic about
> > eggs in general.
> >
> > The py2exe result now has the two egg files in it, but the only way
> > I'm actually able to import them is by doing:
> >
> > sys.path.append('.')
> > pkg_resources.require("RuleDispatch")
> > pkg_resources.require("PyProtocols")
> Sounds like you're close, and it sounds like I left out an important step.
> My code does actually have a pkg_resources.requre() statement in it.
> But, looking back at my setup script, I neglected to mention this:
> eggspth = open("build/eggs.pth", "w")
> for egg in eggs:
>     eggspth.write(os.path.basename(egg.path))
>     eggspth.write("\n")
> And then you add eggs.pth to your data_files. That should get rid of
> your sys.path.append, and will quite possibly eliminate the need for
> you to do pkg_resources.requre().
> Kevin

More information about the Distutils-SIG mailing list