-
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
Resolver preference improvements to avoid trying a dependency for too many times #10172
Comments
install_requires
fail to be resolved in time
To replicate, I created this dockerfile:
It took a while to get the dockerfile right given how clumsy it is to activate an env. But with that dockerfile, I can replicate the error by running |
In order to determine if Setuptools' involvement is implicated here, I've attempted to replicate the issue using pip only (by using a wheel of the local project):
Then, running In any case, the failure with no In my experience this kind of issue happens when the dependency tree is in fact invalid and the resolver goes off trying to satisfy every possible of combination first. I'll hand this off to the pip team to see if they have any more insight. |
Basically #9187. So the problem here is there are multiple possible routes the resolver can go down to find a resolution, and when you do You can actually pretty easily avoid going into that route by supplying I’m going to keep this open (with a modified title) so I can assign to myself as a reminder to ponder on the possibilities. |
install_requires
fail to be resolved in time
One immediate idea is maybe we can “jump between” multiple routes when one route needs backtracking. When |
btw is this specific issue still reproducible? To test if my optimization in #10201 (comment) fixes it I tried create the following requirements file:
And on Python 3.8 or 3.9 at least on Windows I can't reproduce it:
Can you let me know if you can still reproduce the issue? If so I will further attempt to reproduce the environment and see if my optimization fixes it. |
I think can be closed now? I was never able to reproduce issue but #10481 should fix it unless OP states it's still happening since 21.3. |
Thanks everyone, looks like upgrading pip to 21.3 solves the issue! |
setuptools version
setuptools==52.0.0
Python version
Python 3.8
OS
MacOS 11.2.3
Additional environment information
I only tried to reproduce this inside a venv. I also tried with
setuptools==57.2.0
, as well as Python 3.9 and ran into the same issue. This is the output ofconda list
in the venv:Description
When I try to pip install an empty package with the following
setup.py
,pip
seems unable to resolve dependencies and and the installation doesn't commence.However, if I try to install only the dependencies using
pip install "tensorflow<=2.5.0" tf-models-official==2.5.0
it works as expected, which makes me think that this issue is related to
setuptools
, rather thanpip
.Moreover, modifying the
setup.py
to have eithertensorflow==2.5.0
, ortf-models-official
(without explicit version), also fixes the problem, and in either casepip
ends up installing versions2.5.0
anyway.Using
--no-cache-dir
makes no difference.Expected behavior
To install the package as expected.
How to Reproduce
conda create -n tmp python=3.8 -y && conda activate tmp
mkdir tmp && cd tmp
setup.py
:pip install .
Output
This takes so long that I never observed it finish.
Code of Conduct
The text was updated successfully, but these errors were encountered: