Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you uninstall a python package that was installed using distutils?

Tags:

python

Can you simply delete the directory from your python installation, or are there any lingering files that you must delete?

like image 238
Hortitude Avatar asked Dec 31 '08 05:12

Hortitude


People also ask

How do I uninstall Python Setuptools?

Uninstalling. On Windows, if Setuptools was installed using an .exe or . msi installer, simply use the uninstall feature of “Add/Remove Programs” in the Control Panel.

How do you remove an installed package using pip?

To uninstall the package system-wide using pip, first uninstall it locally, then run the same uninstall command again, with root privileges. In addition to the predefined user install directory, pip install --target somedir somepackage will install the package into somedir.


2 Answers

It varies based on the options that you pass to install and the contents of the distutils configuration files on the system/in the package. I don't believe that any files are modified outside of directories specified in these ways.

Notably, distutils does not have an uninstall command at this time.

It's also noteworthy that deleting a package/egg can cause dependency issues – utilities like easy_install attempt to alleviate such problems.

like image 157
cdleary Avatar answered Oct 07 '22 15:10

cdleary


The three things that get installed that you will need to delete are:

  1. Packages/modules
  2. Scripts
  3. Data files

Now on my linux system these live in:

  1. /usr/lib/python2.5/site-packages
  2. /usr/bin
  3. /usr/share

But on a windows system they are more likely to be entirely within the Python distribution directory. I have no idea about OSX except it is more likey to follow the linux pattern.

like image 36
Ali Afshar Avatar answered Oct 07 '22 15:10

Ali Afshar