[Distutils] Uninstall

Alexander Michael lxander.m at gmail.com
Mon Aug 27 12:11:16 CEST 2007

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.).

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.

More information about the Distutils-SIG mailing list