473,382 Members | 1,247 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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 3734
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
corresponding 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.comwrote in message
news:ma***************************************@pyt hon.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.comwrote:
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
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...
8
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...
1
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?...
5
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
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)...
3
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...
0
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...
0
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. ...
0
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.