[Distutils] eggs in Python path

Phillip J. Eby pje at telecommunity.com
Sun Jan 15 18:23:21 CET 2006


At 10:46 AM 1/15/2006 -0500, Jim Fulton wrote:

>The eggs quick guide 
>http://peak.telecommunity.com/DevCenter/PythonEggs#using-eggs
>says that eggs can be installed by just putting them on sys.path.  This 
>doesn't
>seem to be enough though. A .pth file seem to also be necessary.
>
>Am I missing something?

Two somethings.  :)

First, you *can* install an egg by putting it on sys.path.  A .pth file is 
just one *way* of putting it on sys.path.

What you're asking about is installing an egg by putting it *in a directory 
that's on sys.path*, which is a different thing.  You can also do this, as 
long as you're using the pkg_resources API to request the egg, or it's one 
of your requirements specified by your egg.

The only egg that absolutely *must* be in a .pth (or otherwise get onto 
sys.path) is the setuptools egg.  As long as that's the case, then it is 
not necessary to have .pth files, because the act of require()-ing an egg 
will cause it and all its dependencies to be added.


>Or is the documentation incorrect?

It might be a bit confusing about this issue, but I've so far found that 
changing it around doesn't help much.  :(  This is simply something so new 
to most people that they seem to project their existing thought process 
onto it no matter what it actually says, and then only get it after bumping 
into a problem or mental contradiction.  If you think you can improve upon 
the comprehensibility without making it so complex that nobody will read it 
anyway, feel free to submit a patch.  :)



More information about the Distutils-SIG mailing list