Hi all, Someone asked me today, how to uninstall a package that was installed with easy_install. The best I could come up with was, remove the .egg file/directory from site-packages and remove the corresponding line from easy_install.pth. That's pretty lame and error prone. Is there a better way? Martin -- Acquisition is a jealous mistress
At 12:15 AM 8/27/2007 +0100, Martin Aspeli wrote:
Hi all,
Someone asked me today, how to uninstall a package that was installed with easy_install. The best I could come up with was, remove the .egg file/directory from site-packages and remove the corresponding line from easy_install.pth. That's pretty lame and error prone.
Is there a better way?
Somewhat better: http://peak.telecommunity.com/DevCenter/EasyInstall#uninstalling-packages
Phillip J. Eby wrote:
At 12:15 AM 8/27/2007 +0100, Martin Aspeli wrote:
Hi all,
Someone asked me today, how to uninstall a package that was installed with easy_install. The best I could come up with was, remove the .egg file/directory from site-packages and remove the corresponding line from easy_install.pth. That's pretty lame and error prone.
Is there a better way?
Somewhat better:
http://peak.telecommunity.com/DevCenter/EasyInstall#uninstalling-packages
So ... that removes it from easy_install.pth, but doesn't remove the downloaded .egg file/directory? Martin -- Acquisition is a jealous mistress
Martin Aspeli wrote:
Phillip J. Eby wrote:
At 12:15 AM 8/27/2007 +0100, Martin Aspeli wrote:
Hi all,
Someone asked me today, how to uninstall a package that was installed with easy_install. The best I could come up with was, remove the .egg file/directory from site-packages and remove the corresponding line from easy_install.pth. That's pretty lame and error prone.
Is there a better way? Somewhat better:
http://peak.telecommunity.com/DevCenter/EasyInstall#uninstalling-packages
So ... that removes it from easy_install.pth, but doesn't remove the downloaded .egg file/directory?
... mmm, I guess so, in a roundabout kind of way. I think it'd be a huge improvement if easy_install had a '--remove' option or something like that. Even if it just did this exact operation under the hood, it'd be a lot more intuitive. It'd be better if there was a way to remove the scripts and other egg files as well. I don't think people can be expected to realise where eggs are getting installed (i.e. site-packages/foo.egg, and maybe scripts/foobar and whatever else) and find and remove these files. Would easy_install in theory have enough context to work out what files was installed for an egg in the first place? Martin -- Acquisition is a jealous mistress
On 8/26/07, Martin Aspeli <optilude@gmx.net> wrote:
Martin Aspeli wrote: I think it'd be a huge improvement if easy_install had a '--remove' option or something like that. Even if it just did this exact operation under the hood, it'd be a lot more intuitive.
It'd be better if there was a way to remove the scripts and other egg files as well. I don't think people can be expected to realise where eggs are getting installed (i.e. site-packages/foo.egg, and maybe scripts/foobar and whatever else) and find and remove these files.
Would easy_install in theory have enough context to work out what files was installed for an egg in the first place?
As far as I was able to determine, the logic can be recreated, but I couldn't find a record of the user chosen script directory (chosen w/easy_install --script-dir). You could search on PATH, assuming the user has put the script-dir on their PATH, but this starts to get fragile (you might want to look in the file to be sure it is something easy_install created, etc.). You might also run into some issues with projects that have been given egg-info, but not installed by easy_install, not sure on this one. The route I chose to manage uninstalls is to use the --record option to drive an uninstall script. Also fragile because I need to run easy_install my way to make sure the record is generated, but otherwise feels safer to me. I heartily second the need to do this at a more fundamental level. Even if it is just unsinstalling without regard to dependencies. Ultimately, it would be nice to "rotate" the installs, keep just the latest, remove a project and all its dependencies that aren't dependent on anohter installed project, etc., etc. But the first step is being able to install a single project w/o dependencies.
Alexander Michael wrote:
On 8/26/07, Martin Aspeli <optilude@gmx.net> wrote:
Martin Aspeli wrote: I think it'd be a huge improvement if easy_install had a '--remove' option or something like that. Even if it just did this exact operation under the hood, it'd be a lot more intuitive.
It'd be better if there was a way to remove the scripts and other egg files as well. I don't think people can be expected to realise where eggs are getting installed (i.e. site-packages/foo.egg, and maybe scripts/foobar and whatever else) and find and remove these files.
Would easy_install in theory have enough context to work out what files was installed for an egg in the first place?
As far as I was able to determine, the logic can be recreated, but I couldn't find a record of the user chosen script directory (chosen w/easy_install --script-dir). You could search on PATH, assuming the user has put the script-dir on their PATH, but this starts to get fragile (you might want to look in the file to be sure it is something easy_install created, etc.).
Maybe easy_install should also record these things during installation?
You might also run into some issues with projects that have been given egg-info, but not installed by easy_install, not sure on this one.
The route I chose to manage uninstalls is to use the --record option to drive an uninstall script. Also fragile because I need to run easy_install my way to make sure the record is generated, but otherwise feels safer to me.
I heartily second the need to do this at a more fundamental level. Even if it is just unsinstalling without regard to dependencies. Ultimately, it would be nice to "rotate" the installs, keep just the latest, remove a project and all its dependencies that aren't dependent on anohter installed project, etc., etc. But the first step is being able to install a single project w/o dependencies.
I'm sure there are lots of use cases here, and I understand it gets tricky with dependencies, but at the most basic level, I've seen several people hose their Python installs or workingenvs with incompatible eggs that they then try to remove. Martin -- Acquisition is a jealous mistress
On 8/27/07, Martin Aspeli <optilude@gmx.net> wrote:
Maybe easy_install should also record these things during installation?
Personally, I think that would be helpful. I can think of three candidate places that might make sense: 1) right next to the egg as a pkg-1.0-py2.4.egg-record or something... 2) inside the installed egg as part of the egg-info as an installed_files.txt or some such... 3) in a "receipts" directory inside the install-dir The record would only be needed to allow uninstalling (so the std lib wouldn't need it).
I'm sure there are lots of use cases here, and I understand it gets tricky with dependencies, but at the most basic level, I've seen several people hose their Python installs or workingenvs with incompatible eggs that they then try to remove.
Yep. Especially on the bleeding edge of development...
participants (3)
-
Alexander Michael
-
Martin Aspeli
-
Phillip J. Eby