[Distutils] Decompressing .egg files

Phillip J. Eby pje at telecommunity.com
Wed Feb 8 16:13:32 CET 2006


At 02:49 PM 2/8/2006 +0100, Giovanni Bajo wrote:
>Hello,
>
>is there an easy_install option to decompress existing .egg files? I could
>probably run "easy_install -Z name" but that could potentially download and
>install another version.

No, it couldn't.  A download would only occur if you use --find-links 
(prior to the current SVN version) or --upgrade, or if 'name' can't be 
found locally.


>  I'd need an option which pretty much this semantic:
>"if extension `name` exists and its current version is packaged as egg file,
>decompress it into a directory". Does it exist already?

Use --install-dir (-d) and --always-copy (-a) with -Z; this will always 
result in an unpacked egg in the install directory, whether the source was 
packed or not:

     easy_install -Zad tgtdir name

If you don't want dependencies, you should also use --no-deps (-N):

     easy_install -ZaNd tgtdir name

In either case, this will install the egg(s) for 'name' into 'tgtdir', and 
will copy/unpack them there even if they're already on sys.path.  No online 
search will be done unless you have 'find_links' and/or 'upgrade' set in 
one of your distutils config files (setup.cfg, ~/.pydistutils.cfg, 
etc.).  And you could prevent it even then using --allow-hosts (-H) to 
disable any remote access.



More information about the Distutils-SIG mailing list