28

I’ve installed a couple of Python modules using easy_install. How do I uninstall them?

I couldn’t see an uninstall option listed in easy_install --help.

Wooble
  • 87,717
  • 12
  • 108
  • 131
Paul D. Waite
  • 96,640
  • 56
  • 199
  • 270
  • 2
    Duplicate of http://stackoverflow.com/questions/1231688/how-do-i-remove-packages-installed-with-pythons-easy-install where there is more information. – jrouquie Jul 02 '12 at 15:04

2 Answers2

30

Ah, here we go:

$ easy_install -m PackageName

$ rm EggFile

I’m not exactly clear what the -m option does, but this method seems to work for me (i.e. after doing it, I can no longer import the modules in my Python interpreter).

Dave
  • 7,555
  • 8
  • 46
  • 88
Paul D. Waite
  • 96,640
  • 56
  • 199
  • 270
  • You're not removing the egg entirely though. easy_install doesn't support uninstalling, a package manager does, and installing into a virtualenv lets you remove the whole virtualenv. – Tobu Dec 05 '10 at 16:50
  • @Tobu: aha, I wondered whether it got rid of everything. Do you know what `easy_install` leaves behind? Have you got an example of a package manager? – Paul D. Waite Dec 05 '10 at 17:56
  • 5
    To understand what -m does see http://stackoverflow.com/questions/4305610/how-does-python-keep-track-of-modules-installed-with-eggs/4306995#4306995. And deleting the egg zip file or unzipped directory plus -m deletes just about everything. In addition, you'll need to delete any console scripts that were installed. If necessary, you can find any by reinstalling the package and noting the locations that easy_install tells you. – Ned Deily Dec 05 '10 at 18:18
  • 1
    What it leaves behind varies (scripts, egg-info, data come to mind), the problem is that nothing is tracked. On linux, consider `checkinstall` as the cheapest way to build a package. – Tobu Dec 05 '10 at 18:28
2

easy_install did work for me.

I also was able to test that easy_install -m short name worked. For example:

easy_install -m mesos # ( short for mesos-0.16.0-py2.6-linux-x86_64.egg)

pip uninstall mesos also ending up working with short name.

Paul D. Waite
  • 96,640
  • 56
  • 199
  • 270
bma398
  • 21
  • 1