Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remove packages installed with Python's easy_install?

Python's easy_install makes installing new packages extremely convenient. However, as far as I can tell, it doesn't implement the other common features of a dependency manager - listing and removing installed packages.

What is the best way of finding out what's installed, and what is the preferred way of removing installed packages? Are there any files that need to be updated if I remove packages manually (e.g. by rm /usr/local/lib/python2.6/dist-packages/my_installed_pkg.egg or similar)?

like image 422
ire_and_curses Avatar asked Aug 05 '09 07:08

ire_and_curses


People also ask

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.

Can you uninstall packages with pip?

pip is able to uninstall most installed packages. Known exceptions are: Pure distutils packages installed with python setup.py install , which leave behind no metadata to determine what files were installed.

Does uninstalling Python remove all packages Windows?

@patelshahrukh uninstalling python DOES NOT remove pip packages. please AVOID doing that, since it both most likely WON'T WORK the way you think it will, and, depending on how you install python again, can leave your machine in an unstable state that's more work to fix.


2 Answers

pip, an alternative to setuptools/easy_install, provides an "uninstall" command.

Install pip according to the installation instructions:

$ wget https://bootstrap.pypa.io/get-pip.py $ python get-pip.py 

Then you can use pip uninstall to remove packages installed with easy_install

like image 93
lunaryorn Avatar answered Sep 30 '22 11:09

lunaryorn


To uninstall an .egg you need to rm -rf the egg (it might be a directory) and remove the matching line from site-packages/easy-install.pth

like image 42
joeforker Avatar answered Sep 30 '22 09:09

joeforker