[Distutils] py2exe and eggs

Kevin Dangoor dangoor at gmail.com
Tue Aug 16 18:36:02 CEST 2005


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