![](https://secure.gravatar.com/avatar/9358fac88a1320409e7842a71dde5fcf.jpg?s=120&d=mm&r=g)
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. 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? -- Giovanni Bajo
![](https://secure.gravatar.com/avatar/2748c5c3129451e26aa262b20d62d39a.jpg?s=120&d=mm&r=g)
I think you can just unzip them, since they are zip files. Some programs might complain about the different extension though. On 2/8/06, Giovanni Bajo <rasky@develer.com> 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. 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? -- Giovanni Bajo
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
![](https://secure.gravatar.com/avatar/9358fac88a1320409e7842a71dde5fcf.jpg?s=120&d=mm&r=g)
Charlie Moad <cwmoad@gmail.com> wrote:
I think you can just unzip them, since they are zip files. Some programs might complain about the different extension though.
True, but you'll have to locate which .egg file is the current one for a given module (there is no 1:1 match between python module names and egg files, and you can have multiple versions installed). Also you can't just decompress it: you need to create a wrapper directory with the same name (including extension) of the .egg file. This also means that you need to do it in two steps since you can't have both a file and a directory with the same name at the same time. I was wondering if there was already something ready-made so that I could just do "easy_install --decompress pysqlite" and forget about it. If not, I hope the future "nest" command will handle this. -- Giovanni Bajo
![](https://secure.gravatar.com/avatar/eaa875d37f5e9ca7d663f1372efa1317.jpg?s=120&d=mm&r=g)
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.
![](https://secure.gravatar.com/avatar/eaa875d37f5e9ca7d663f1372efa1317.jpg?s=120&d=mm&r=g)
At 10:13 AM 2/8/2006 -0500, Phillip J. Eby wrote:
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.
I forgot to mention, by the way, that 'tgtdir' cannot be the same directory where the original egg is. If you want to update an egg in place, use a temporary directory like this: easy_install -aNd some_temp_dir name easy_install -aNZ some_temp_dir/name*.egg which will first copy the egg to the temporary directory, then unpack it back to its original location (more or less).
![](https://secure.gravatar.com/avatar/9358fac88a1320409e7842a71dde5fcf.jpg?s=120&d=mm&r=g)
Phillip J. Eby <pje@telecommunity.com> wrote:
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
This works, but specifying the target directory is something I would like to avoid. My scenario is this: I run "easy_install foobar", and easy_install downloads and installs foobar.egg (zip file). After that, I decide that I need it to be a directory, *not* a zip file. I'd expect something like "easy_install -Z foobar" to be sufficient. I tried with: easy_install -Zad c:\python24\lib\site-packages foobar and it worked, but it feels wrong to be forced to specify the site-packages directory. I just want to obtain the same result *as if* I had specified -Z when it first downloaded the file.
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.
Thanks for this explanation. -- Giovanni Bajo
participants (3)
-
Charlie Moad
-
Giovanni Bajo
-
Phillip J. Eby