-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Existing numpy installations are not getting cleaned up correctly #6143
Comments
Hehe. Bug Reports are welcome. :) This seems reasonable to me. I can't think of "sane" setups, that are not-broken currently and would break if we do this. PS: I rephrased the title, to be shorter. Hopefully, I got it right. :) |
pip's pip/src/pip/_internal/req/req_install.py Lines 755 to 763 in 0637aad
This leads me to think that easy_install isn't (or at least shouldn't be) doing anything with the numpy dependency. Or am I misunderstanding your explanation? The pip docs also say this:
|
Yeah, pip handles dependencies itself. $ tree
.
├── setup.py
└── trial
└── __init__.py
1 directory, 2 files
$ cat setup.py
from setuptools import setup, find_packages
setup(
name="trial",
version="0.1.0",
packages=find_packages(),
install_requires=["six"]
)
$ pip install -e .
Obtaining file:///Users/pradyunsg/.virtualenvs/tmp-74d363ab9317367/trial
Collecting six (from trial==0.1.0)
Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: six, trial
Running setup.py develop for trial
Successfully installed six-1.12.0 trial Seems like the explanation is OP is not correct. It'll still be useful to investigate why there are leftover files. |
Thanks for confirming, @pradyunsg. The title should probably be changed too, then, to describe the problem that occurred rather than the conjectured explanation / proposed solution. |
@njsmith It would be good to have log output of one of the confirmed problem cases to get a better understanding of the issue. (You're probably more familiar with which cases in the linked issue best illustrate the issue you're posting.) |
I guess this should do. I'll avoid touching the title again though. |
Unfortunately I have no real idea how these users ended up with messed up installs. I filed this based on one specific comment that claimed to have tested a minimal reproducer: But then it turns out that the very next comment claims to have failed to reproduce the problem, just like Pradyun: So... I dunno! I suppose it could be dependent on setuptools or pip version, or just a mistake somewhere. If anyone wants to jump in that thread to try to get more details out of the reporters then it might be useful? But I'm not sure there's any real pip bug here at all. |
Here is a reproduction of the bug on an empty ubuntu 18.04 docker image: |
I'm updating my findings on that issue, strange: |
Ok, found the bug it's in debian modification of the original pip source code: |
Duplicate of #4222 |
Thanks for some really nice investigation @tzickel! I'll go ahead and close this issue then. :) |
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. |
The latest version of numpy breaks if you install it over a previous version of numpy, without properly uninstalling the previous version. So we're getting to re-discover all the cases where packages get installed without the metadata that pip needs to remove them again properly: numpy/numpy#12736
One case in particular seems particular surprising:
install_requires=["numpy==old_version"]
pip install -e <this package>
pip install numpy==latest_version
Now you have a corrupted numpy install, that's a mixture of the old and new versions.
I assume what's happening is that
pip install -e <this package>
is callingsetup.py develop
, which is then usingeasy_install
to satisfy thenumpy==old_version
requirement, andeasy_install
doesn't record the metadata that pip needs to uninstall the old version.For regular installs, pip has historically avoided this by first running
setup.py egg_info
, then installing all theinstall_requires
packages, and then invokingsetup.py install
. I think it could do the exact same thing for editable installs: first runsetup.py egg_info
, install the requirements, and then runsetup.py develop
. Maybe it should?The text was updated successfully, but these errors were encountered: