pip: pip uninstall not working with editable dependencies
- Pip version: 10.0.0b2 as well as 10.0.0b2+ (8e074408d69f4b1e064dbc8908f1ec7dcf034be5)
- Python version: 2.7.12
- Operating system: Ubuntu 16.04
Description:
After installing an editable dependency from vcs, it cannot be uninstalled. With pip 9 it did uninstall correctly, removing the .egg-link file.
What I’ve run:
$ virtualenv --version
15.0.1
$ virtualenv venv
$ venv/bin/pip --version
10.0.0b2 # wondering why I'm getting a beta version of pip without asking but that's not the point here
$ venv/bin/pip install -e git+https://github.com/pallets/click.git#egg=click
Obtaining click from git+https://github.com/pallets/click.git#egg=click
Updating ./venv/src/click clone
Installing collected packages: click
Running setup.py develop for click
Successfully installed click
$ venv/bin/pip uninstall click
Can't uninstall 'click'. No files were found to uninstall.
$ venv/bin/pip list
Package Version Location
------------- -------- ----------------------------------
click 7.0.dev0 /home/sbi-local/tmp/venv/src/click
pip 10.0.0b2
pkg-resources 0.0.0
setuptools 39.0.1
wheel 0.31.0
I expected click to be uninstalled at this point.
If I downgrade to pip 9.0.3, it works:
$ venv/bin/pip install pip==9.0.3
Collecting pip==9.0.3
Using cached pip-9.0.3-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 10.0.0b2
Uninstalling pip-10.0.0b2:
Successfully uninstalled pip-10.0.0b2
Successfully installed pip-9.0.3
$ venv/bin/pip uninstall click
Uninstalling click-7.0.dev0:
/home/sbi-local/tmp/venv/lib/python2.7/site-packages/click.egg-link
Proceed (y/n)? y
Successfully uninstalled click-7.0.dev0
$ venv/bin/pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
pip (9.0.3)
pkg-resources (0.0.0)
setuptools (39.0.1)
wheel (0.31.0)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 46 (35 by maintainers)
Well, consider myself nerdsniped 😆
I attempted to bisect this, hope this is helpful 😃
I had to apply the patch listed in 310bcfc78fea8f1f2bc4f680b376e18bf5aeed07 early so that the bisect was able to differentiate between a bunch of “broken” commits which ended with:
After the bisect run, it points at this:
CC @dstufft 904fcf1f177770a4eb05e0850d79265e4bc0907f
A further triage, the failure appears to come from a differing return value in
dist_is_local
here:https://github.com/pypa/pip/blob/d67d98dd914e2ce80ece43594554f0a226558db0/src/pip/_internal/req/req_uninstall.py#L276
The difference appears to be the return values here:
On Saturday, May 23, 2020 8:06:13 PM EDT Tzu-ping Chung wrote:
Since I’m the primary maintainer for virtualenv and pip in Debian right now, it wouldn’t make me any more aware of it than I am now.
Also, don’t assume the previous discussion is right. I tried a patch very similar to the linked pull request and it didn’t solve the problem. That may be on me for either not getting the change right or not testing correctly, but I’m not 100% sure the previous discussion is on the right path.
🤷 it used to work though is my point
I took a look a this on Debian stable as well as unstable/testing. Click is now python3 only so the original problem with that repository can’t occur. I tried the reproduction steps on python3 and it uninstalled fine.
I don’t know how much effort it’s worth fixing python2 stuff now, but if someone will provide another example where the problem still occurs I will take a look at it.