473,770 Members | 7,287 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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?
Jul 12 '06 #1
9 3761
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?
Jul 12 '06 #2
On 2006-07-12, Nick Vatamaniuc <va******@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!!
Jul 12 '06 #3
>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
Jul 12 '06 #4
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.
sk**@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
Jul 12 '06 #5

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
Jul 12 '06 #6
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. :)

<sk**@pobox.com wrote in message
news:ma******** *************** *************** *@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

Jul 12 '06 #7
Skip,
I agree. Some kind of a manifest or log file would be great and
probably not that hard to implement.
Nick
sk**@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
Jul 12 '06 #8
Grant Edwards <gr****@visi.co mwrote:
On 2006-07-12, Nick Vatamaniuc <va******@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 <ni**@craig-wood.com-- http://www.craig-wood.com/nick
Jul 13 '06 #9

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
>
sk**@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
Jul 13 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
2505
by: Thomas Heller | last post by:
ctypes 0.9.2 released - Oct 28, 2004 ==================================== Overview ctypes is a ffi (Foreign Function Interface) package for Python 2.3 and higher. ctypes allows to call functions exposed from dlls/shared libraries and has extensive facilities to create, access and manipulate
8
2072
by: Georg Brandl | last post by:
Hello c.l.py, what features would you expect of a Python package manager, similar to CPAN or rubygems? I am currently planning to write such a thing, at first privately for myself, and if it's proving useful, I think about releasing it. I plan to model it after gentoo's portage, with less features of course. Would this be acceptable?
1
1263
by: Kay Schluehr | last post by:
In almost any case I install a Python package via distutils some directories in the package tree are left behind e.g. the docs, licenses, tests etc. I wonder if there is some rationale behind this? Should it be left to the "creative freedom" of the user to copy the docs whereever she wants or is there a dedicated place for them and if any why isn't it simple to declare it in the setup script?
5
4245
by: siggi | last post by:
Hi all, installing a package with 'setup.py' is easy. But how do I uninstall the package, once I want to get rid of it again? Thanks, siggi
0
1004
by: =?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?= | last post by:
The Python Packaging Index (the software formerly known as Cheeseshop) is now available at http://pypi.python.org/pypi The old addresses (www.python.org/pypi, and cheeseshop.python.org/pypi) will continue to work, either as aliases or using HTTP redirections. The software was renamed to its old name
3
1372
by: Wildemar Wildenburger | last post by:
Hello there, I'm exploring possibilities of using python as an alternative to Matlab. The obvious way to go seems to be matplotlib for plotting, but I do like GLE <URL:http://glx.sourceforge.net/a lot. One reason is that with GLE you can also do diagrams, that is, descriptive pictures (like <URL:http://glx.sourceforge.net/examples/diagrams/index.html>) Is there anything similar for python?
0
862
by: Tim Cook | last post by:
Hi All, I would like feedback on the proper/best 'Pythonic' approach. This is a rather subjective question. Where is the trade-off between package name lengths and faithfulness to the specifications? I am implementing a set of specifications for healthcare IT for Python
0
1069
by: Roger Ineichen | last post by:
Hi Tim For a usecase like this, I personaly recommend to defina all interfaces in one module which probably is a namespace if you need alot of interfaces to define. e.g. openehr.interfaces.foobar.IFooBar
0
1148
by: Mathieu Prevot | last post by:
2008/9/24 Jaime Huerta Cepas <jhuerta@cipf.es>: IMHO this is too complex to commit. Macport is a way to do what you want, but packages may not be up to date enough. Maybe the easiest and simplest way for you to do this is to write a script that will download, compile and install everything. The script should work like: sudo all_in_one_script.py
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10230
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9870
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8886
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7416
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.