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)?
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.
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.
@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.
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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With