distutils uninstall

R

Rick Muller

I've been trying to figure out whether there are any plans to add an
"uninstall" feature to the Python distutils. Googling has found
several people posting the same question, but, to the best of my
knowledge, no answers.

Can anyone tell me whether this has been proposed before? Thanks in
advance.
 
S

Skip Montanaro

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
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Rick said:
I've been trying to figure out whether there are any plans to add an
"uninstall" feature to the Python distutils. Googling has found
several people posting the same question, but, to the best of my
knowledge, no answers.

As Skip explains: no. Instead, use a bdist_ command, then use the
uninstall mechanism of the binary packaging technology (e.g. wininst,
rpm).

There are some complaints that bdist-generated packages don't properly
uninstall either (e.g. may not remove directories properly);
contributions are welcome.

Regards,
Martin
 
R

Rick Muller

Skip Montanaro said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top