distutils uninstall

Rick Muller rick_muller at yahoo.com
Thu Jan 22 18:07:23 CET 2004


Skip Montanaro <skip at pobox.com> wrote in message news:<mailman.598.1074702856.12720.python-list at python.org>...
> Rick> I've been trying to figure out whether there are any plans to add
>     Rick> an "uninstall" feature to the Python distutils. Googling has found
>     Rick> several people posting the same question, but, to the best of my
>     Rick> knowledge, no answers.
> 
> This has been proposed before.  It's not a trivial problem though.
> Distutils would need to record all the files and directories it creates
> during installation and carefully remove stuff during the uninstall process
> (do things "backwards", not remove directories which still contain files,
> etc).  That wouldn't be foolproof though, because unlike packaging systems
> such as Red Hat's RPM, you don't have a full system picture.  What if your
> distutils-installed package provides a new version of /etc/magic?  If you
> uninstall it, /etc/magic would be deleted, since distutils couldn't tell
> that /etc/magic was actually used by many other parts of the system.
> 
> Skip

Thanks for the reply, Skip.

I actually had a simpler case in mind, that you go to the directory
from which you installed the software, and typed 'setup.py uninstall',
since the setup.py script should be able to determine which files it
originally installed, and remove them.

Certainly not foolproof, but it may be useful all the same.



More information about the Python-list mailing list