How to delete a Python package

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

    How to delete a Python package

    Installing a Python package is easy, most of time just
    "Setup.py install" However, setup.py doesn't seem to support
    an uninstall command. If I want to delete a package that I
    do not use any more, should I just manually delete the
    corresponding sub directory under Lib\site-packages?


  • Nick Vatamaniuc

    #2
    Re: How to delete a Python package

    Jack,

    As a rule, if you use a Linux distribution, you should just install
    the package and then remove the package using the package manager.
    Distutils uninstallation is not supported. Of course you could manually
    delete the directory in site-packages in most, but not all (!) cases,
    that should remove all the files of the package.

    Nick Vatamaniuc

    Jack wrote:
    Installing a Python package is easy, most of time just
    "Setup.py install" However, setup.py doesn't seem to support
    an uninstall command. If I want to delete a package that I
    do not use any more, should I just manually delete the
    corresponding sub directory under Lib\site-packages?

    Comment

    • Grant Edwards

      #3
      Re: How to delete a Python package

      On 2006-07-12, Nick Vatamaniuc <vatamane@gmail .comwrote:
      >Installing a Python package is easy, most of time just
      >"Setup.py install" However, setup.py doesn't seem to support
      >an uninstall command. If I want to delete a package that I
      >do not use any more, should I just manually delete the
      >correspondin g sub directory under Lib\site-packages?
      As a rule, if you use a Linux distribution, you should just install
      the package and then remove the package using the package manager.
      That's fine except a lot of python packages aren't available in
      any of the various Linux distro package formats.
      Distutils uninstallation is not supported. Of course you could
      manually delete the directory in site-packages in most, but
      not all (!) cases, that should remove all the files of the
      package.
      --
      Grant Edwards grante Yow! I hope something GOOD
      at came in the mail today so
      visi.com I have a REASON to live!!

      Comment

      • skip@pobox.com

        #4
        Re: How to delete a Python package

        >As a rule, if you use a Linux distribution, you should just install
        >the package and then remove the package using the package manager.
        GrantThat's fine except a lot of python packages aren't available in
        Grantany of the various Linux distro package formats.

        And one or two people don't use Linux yet.

        Uninstall support would be a good idea...

        Skip

        Comment

        • Nick Vatamaniuc

          #5
          Re: How to delete a Python package

          Skip,

          Uninstall support is hard, you would turn distutils (setup.py) into a
          package management system, but wait...! there are already package
          managers that do exactly that (rpm, deb, Windows Installer).

          If no distro installer package is available for your Python module --
          build it yourself and when done share with others, you are probably
          already using a lot of stuff created by others, so if you see something
          missing, add it, and give back to the community.

          Or you could just use the package folder locally in your project to
          begin with and never bother with a system-wide install. In general, for
          a 'clean' system try not to use multiple installers or incompatible
          package managers to put stuff in your system directories -- it will
          create a mess over time.

          I use Ubuntu, and so far I was able to find all the Python modules I
          need as an installable .deb file, that is why I suggested Linux.
          Actually as far as I am concerned, having all your modules, IDEs, and
          libraries available in a nicely organized repository, available at the
          touch of an 'agt-get' command is a pretty good reason to switch.

          Nick V.


          skip@pobox.com wrote:
          As a rule, if you use a Linux distribution, you should just install
          >the package and then remove the package using the package manager.
          >
          GrantThat's fine except a lot of python packages aren't available in
          Grantany of the various Linux distro package formats.
          >
          And one or two people don't use Linux yet.
          >
          Uninstall support would be a good idea...
          >
          Skip

          Comment

          • skip@pobox.com

            #6
            Re: How to delete a Python package


            NickUninstall support is hard, you would turn distutils (setup.py)
            Nickinto a package management system, but wait...! there are already
            Nickpackage managers that do exactly that (rpm, deb, Windows
            NickInstaller).

            Note that I don't really care about uninstall support, certainly not enough
            to go through the pain of editing distutils. I'd be happy if the installer
            wrote a MANIFEST file that tells me what files and directories it did
            install. I'm not as worried about dependencies or overlaps between packages
            as much as making sure that when I want to get rid of package X I can
            actually delete all of its files. I also realize that's not truly package
            management in the rpm/deb sense, but that would be good enough for me.

            My message was simply pointing out that telling people "use RPM or DEB" is
            not really acceptable. Not everyone uses Linux. Or Windows. Or Macs.
            Python is a cross-platform language. Through distutils it includes a basic
            cross-platform installation facility. It probably ought to also have a
            corresponding basic cross-platform uninstall facility.

            Skip

            Comment

            • Jack

              #7
              Re: How to delete a Python package

              I'd second Skip's point. Now that setup.py does install, and it knows what
              to
              uninstall (because it copied the files in the first place) I think it's a
              good idea
              to have "setup.py uninstall" support. :)

              <skip@pobox.com wrote in message
              news:mailman.80 93.1152734673.2 7775.python-list@python.org ...
              >
              NickUninstall support is hard, you would turn distutils (setup.py)
              Nickinto a package management system, but wait...! there are already
              Nickpackage managers that do exactly that (rpm, deb, Windows
              NickInstaller).
              >
              Note that I don't really care about uninstall support, certainly not
              enough
              to go through the pain of editing distutils. I'd be happy if the
              installer
              wrote a MANIFEST file that tells me what files and directories it did
              install. I'm not as worried about dependencies or overlaps between
              packages
              as much as making sure that when I want to get rid of package X I can
              actually delete all of its files. I also realize that's not truly package
              management in the rpm/deb sense, but that would be good enough for me.
              >
              My message was simply pointing out that telling people "use RPM or DEB" is
              not really acceptable. Not everyone uses Linux. Or Windows. Or Macs.
              Python is a cross-platform language. Through distutils it includes a
              basic
              cross-platform installation facility. It probably ought to also have a
              corresponding basic cross-platform uninstall facility.
              >
              Skip

              Comment

              • Nick Vatamaniuc

                #8
                Re: How to delete a Python package

                Skip,
                I agree. Some kind of a manifest or log file would be great and
                probably not that hard to implement.
                Nick


                skip@pobox.com wrote:
                NickUninstall support is hard, you would turn distutils (setup.py)
                Nickinto a package management system, but wait...! there are already
                Nickpackage managers that do exactly that (rpm, deb, Windows
                NickInstaller).
                >
                Note that I don't really care about uninstall support, certainly not enough
                to go through the pain of editing distutils. I'd be happy if the installer
                wrote a MANIFEST file that tells me what files and directories it did
                install. I'm not as worried about dependencies or overlaps between packages
                as much as making sure that when I want to get rid of package X I can
                actually delete all of its files. I also realize that's not truly package
                management in the rpm/deb sense, but that would be good enough for me.
                >
                My message was simply pointing out that telling people "use RPM or DEB" is
                not really acceptable. Not everyone uses Linux. Or Windows. Or Macs.
                Python is a cross-platform language. Through distutils it includes a basic
                cross-platform installation facility. It probably ought to also have a
                corresponding basic cross-platform uninstall facility.
                >
                Skip

                Comment

                • Nick Craig-Wood

                  #9
                  Re: How to delete a Python package

                  Grant Edwards <grante@visi.co mwrote:
                  On 2006-07-12, Nick Vatamaniuc <vatamane@gmail .comwrote:
                  As a rule, if you use a Linux distribution, you should just install
                  the package and then remove the package using the package manager.
                  >
                  That's fine except a lot of python packages aren't available in
                  any of the various Linux distro package formats.
                  distutils has a build rpm option which works, eg

                  python setup.py bdist_rpm

                  I usually run debian systems, so I then run alien on the resulting rpm
                  to turn it into a .deb.

                  I always install python packages like this - it has worked every time
                  so far!

                  --
                  Nick Craig-Wood <nick@craig-wood.com-- http://www.craig-wood.com/nick

                  Comment

                  • zarrg@hotmail.com

                    #10
                    Re: How to delete a Python package


                    Nick Vatamaniuc wrote:
                    Skip,
                    I agree. Some kind of a manifest or log file would be great and
                    probably not that hard to implement.
                    Nick
                    What's wrong with the "record" option of install:
                    python setup.py install --record installed_files

                    Then it's pretty easy to do:
                    rm -rf `cat installed_files `

                    Hmm, I guess that's easy on *nix.
                    Maybe setup *should* support uninstall for consistant cross-platform
                    behavior.

                    -- George
                    >
                    skip@pobox.com wrote:
                    NickUninstall support is hard, you would turn distutils (setup.py)
                    Nickinto a package management system, but wait...! there are already
                    Nickpackage managers that do exactly that (rpm, deb, Windows
                    NickInstaller).

                    Note that I don't really care about uninstall support, certainly not enough
                    to go through the pain of editing distutils. I'd be happy if the installer
                    wrote a MANIFEST file that tells me what files and directories it did
                    install. I'm not as worried about dependencies or overlaps between packages
                    as much as making sure that when I want to get rid of package X I can
                    actually delete all of its files. I also realize that's not truly package
                    management in the rpm/deb sense, but that would be good enough for me.

                    My message was simply pointing out that telling people "use RPM or DEB" is
                    not really acceptable. Not everyone uses Linux. Or Windows. Or Macs.
                    Python is a cross-platform language. Through distutils it includes a basic
                    cross-platform installation facility. It probably ought to also have a
                    corresponding basic cross-platform uninstall facility.

                    Skip

                    Comment

                    Working...