[Distutils] Uninstall

Martin Aspeli optilude at gmx.net
Mon Aug 27 21:59:56 CEST 2007


Alexander Michael wrote:
> On 8/26/07, Martin Aspeli <optilude at 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



More information about the Distutils-SIG mailing list