Pip: Can't uninstall projects installed with "pip install -e"

Created on 26 Jun 2014  Â·  19Comments  Â·  Source: pypa/pip

After installing a project (I've tried two) with pip install -e . and then running pip uninstall <project>, the egg-link remains in place and the pth remains altered.

If instead pip install -e <path/to/project> is used to install, pip uninstall <project> returns Can't uninstall '<project>'. No files were found to uninstall.

pip: 1.5.5
python: 2.7.6

pip installed on Ubuntu 14.04 via python-pip package.

auto-locked

Most helpful comment

The solution that worked for me.
It will create a .egg-info file inside the directory where we run pip install -e .
Go to that directory and delete .egg-info file.
Then cross check with pip list

All 19 comments

are these public projects that I can try?
the <project> name has to be equal to the name in setup.py.

I believe I had this issue with both salt and kvgit.

have same problem with pip3 from ubuntu 14.04 package "python3-pip":

% pip3 install -e /path/to/X
...
Successfully installed X
Cleaning up...
% pip3 list
...
X
...
% pip3 uninstall X
Can't uninstall 'X'. No files were found to uninstall.

Yes, this is pretty annoying - even Salt isn't smart enough to ensure removal with its "pip.removed" state, and even though Salt could be enhanced to look for the folder, remove, it, futz with the .pth file, etc, it would certainly seem the right place for this would be in pip itself; uninstall should just work properly.
JJW

Just ran into this, is anyone aware of a workaround?

@jszwedko what version of pip are you using now?

@Ivoz this was with 8.1.1.

this problem bite me too. pip --version == 8.1.1.

For those having this problem:

  1. Running pip ... would usually run system installed pip and as such would require sudo which in turn often modifies environment before running process (btw, if you use sudo you should always include the full invocation when raising issue). Check if the pip you are running is for the instance of Python you think it is.
  2. Do running uninstall twice solves the problem? Take a look at https://github.com/pypa/pip/pull/1552

+1 affects me

I haven't had this issue in a long time. I always work in a virtualenv, and run pip install -U pip to get latest pip.

Yea, me too, but sometimes I need to install/maintain a package for all
users (like the pip package itself). And sometimes I absolutely must
install -e from git or a local path. I think perhaps sudo pip install
instead of sudo -H pip install is what caused my grief. Having the latest
version of pip doesn't fix that. It would be awesome if someone on the pip
project figured out a way to robustly uninstall. In a perfect world pip
uninstall could handle pip install -ed packages for all possible installs
like -e git_url, -e local/path, sudo pip, non-sudo pip, setup.pys
that may or may not use setuptools, etc. pip is the gateway drug for
python after all...

--Hobson
(503) 974-6274
gh https://github.com/hobson/ twtr https://twitter.com/hobsonlane li
https://www.linkedin.com/in/hobsonlane g+
http://plus.google.com/+HobsonLane/ so
http://stackoverflow.com/users/623735/hobs

On Thu, Aug 4, 2016 at 3:39 PM, Matthew Williams [email protected]
wrote:

I haven't had this issue in a long time. I always work in a virtualenv,
and run pip install -U pip to get latest pip.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/pypa/pip/issues/1895#issuecomment-237704764, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAR390M-je9QGzq6kIdpj01WAjGFVTPlks5qcmokgaJpZM4CHr8q
.

Closing this, I can't reproduce this. If you're still having issues please open a new issue with reproduction steps (ideally using a fresh docker container or similar).

I have the exact same problem as @hobson, with sudo as opposed to sudo -H as the likely culprit. Do you have a solution for uninstalling packages installed with sudo pip3 install -e?

Solution: the advice from this stackoverflow question worked for me.

The solution that worked for me.
It will create a .egg-info file inside the directory where we run pip install -e .
Go to that directory and delete .egg-info file.
Then cross check with pip list

I've installed gym successfully with this line:
sudo pip3 install gym --upgrade --ignore-installed

The solution that worked for me.
It will create a .egg-info file inside the directory where we run pip install -e .
Go to that directory and delete .egg-info file.
Then cross check with pip list

Thank you much for the solution, it worked for me, too.
Actually I found a directory named projectname.egg-info in the project repository, not a file.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings