distutils uninstall

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rick Muller

    distutils uninstall

    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.
  • Skip Montanaro

    #2
    Re: distutils uninstall


    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


    Comment

    • Martin v. Löwis

      #3
      Re: distutils uninstall

      Rick Muller wrote:[color=blue]
      > 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.[/color]

      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

      Comment

      • Rick Muller

        #4
        Re: distutils uninstall

        Skip Montanaro <skip@pobox.com > wrote in message news:<mailman.5 98.1074702856.1 2720.python-list@python.org >...[color=blue]
        > 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[/color]

        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.

        Comment

        Working...