45

I'm using pip in a virtualenv and have installed a package from a git repo by doing this:

pip install -e git://github.com/dwaiter/django-bcrypt.git@475a3bef1e3ff31935a2dc905e244a63a804fce9#egg=django_bcrypt-dev

But I now want to uninstall that and can't see how, as it doesn't have a conventional package name. I've tried what seem like obvious variations (like replacing 'install' with 'uninstall') but can't see how to do this from the docs.

(In this case I ultimately want to upgrade from the git repo version of django-bcrypt to version 0.9.2, and am assuming I need to uninstall the git version first.)

Phil Gyford
  • 13,432
  • 14
  • 81
  • 143

1 Answers1

55

You uninstall it like you would any other library:

pip uninstall django-bcrypt

If you want to ultimately upgrade, you could also do

pip install --upgrade -e git://github.com/dwaiter/django-bcrypt.git#egg=django_bcrypt

zsquare
  • 9,916
  • 6
  • 53
  • 87
  • Doh, what an idiot I am. I thought I'd tried everything, including "pip uninstall django-bcrypt-dev" but must have overlooked the most obvious! Thanks zsquare. – Phil Gyford Jan 19 '12 at 13:44
  • 1
    No problemo :). Extra characters so that i can post this damn comment – zsquare Jan 19 '12 at 15:08
  • 3
    It doesn't work for me. `pip freeze` gives "-e git://github.com/mikemaccana/python-docx.git@53a0e3dd0e91ff9c911e8d8824a7c89df6c587c8#egg=docx-dev" but `pip uninstall python-docx` result in error "Cannot uninstall requirement python-docx, not installed". With pip 1.0.2. Any idea why? Thanks in advance. – Pascal Polleunus Apr 02 '12 at 14:08
  • 1
    Ok, it works. The right package name was in fact just "docx", not "python-docx" nor "docx-dev". – Pascal Polleunus Apr 02 '12 at 15:03
  • This didn't work for me at first. It turns out pip 1.0.2 didn't work for me, but pip 1.1 did. "pip install pip --upgrade" solved my problem. – Nils May 06 '12 at 19:39
  • This does not work... I'm running pip 1.1 and it's still broken. The uninstall feature in pip has always been horribly unreliable. – Cerin May 27 '12 at 02:39
  • 2
    Had this issue too, turns out the package was installed in some weird location and pip would say "Uninstalled successfully" when it wasn't actually uninstalled. You can find it by doing: `python -c 'import X; help(X)'` and just deleting the folder. – robbrit Dec 06 '12 at 15:50
  • If this answer doesn't work for you, try http://stackoverflow.com/a/18818891/556413 – glarrain Nov 30 '13 at 19:35
  • Looks like name is what goes after `#egg=` – mrgloom Jun 24 '19 at 16:45
  • Sometimes the package has unexpected name, e.g. ansible (when *pip install ansible --user*) vs. ansible-base (when *pip install --user*). Using *pip list* might help in this case. – alx May 17 '20 at 13:09
  • Yes I had this problem when a git repo had a hyphen (some-package) whereas the package itself did not (somepackage). `pip uninstall some-package` does not work, but `pip install somepackage` does. `pip list` as suggested prints the right name for uninstalling (although it could be tough to know what is what if it is a non-obvious package name) – Andrew Feb 01 '21 at 21:30