-
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
Pip try to install twice the same package at different versions, leading to conflicts #13092
Comments
Thanks for reporting. This issue is a duplicate of #12768 and #12317, pip isn't actually trying to install different versions of the same package, it's just a bug in the resolution and the final resolution impossible message. It will be fixed by #13001. Looking at the resolution details the problem is largely about finding non-conflicting sphinx requirements, as However, this is still quite a problematic resolution and once that bug is fixed pip will struggle to resolve it. There are no reasonable lower bounds on the dependencies of this project: https://github.com/google-research/kauldron/blob/main/pyproject.toml#L17 and therefore the search space is massive, so I would strongly advise you add reasonable lower bounds to the requirements where you can. I also note that even uv can not solve this resolution (
Pip only installs what you ask it to install, it does not not guarantee it will keep consistent with the current environment, so when you give it a small set of requirements to install it is much faster. |
Thanks for the answer. This makes sense
I think pinning dependencies would just add to the problem as if other packages are doing this, it makes finding compatible version even harder. In general I think it's best for libraries to have requirements as loose as possible. I assume if But indeed just specifying a lower bound is good. |
Yes, this is true in general, but given this is for a "docs" extra, I assumed that the only time someone would want this extra is when generating docs for the project. For such a case I think it's okay to pin. FYI, I've added this requirement to a list of known problematic scenarios: https://github.com/notatallshaw/Pip-Resolution-Scenarios-and-Benchmarks/blob/main/scenarios/problematic.toml#L240. And you can see a representation of the resolution here: https://github.com/notatallshaw/Pip-Resolution-Scenarios-and-Benchmarks/blob/main/output/problematic/kauldron-docs/24.3.json The format of the resolution representation isn't final yet, so it may change in the future. But currently in the "added" section of each round you can see what packages it tried to add and the requirements those packages had, "pinned" is if something was successfully included in the resolution, and in the "rejected" section you can see the requirements that were involved when something couldn't be "pinned". I'm working on seeing if it's possible to make it easy to identify where in a resolution things "went wrong" and if there are better heuristics pip could have to make a better resolution. Pip employs a fairly simple resolution strategy right now with a few optimizations, but it could definitely be better. |
Description
It seems in some cases, Pip try to install multiple versions of the same package, leading to conflict resolution:
It's not clear why pip install all those versions. Installing
pip install myst-nb
orpip install sphinx-apitree[ext]
works. It seems the issue is triggered only when installing locallypip install .[docs]
.Expected behavior
Packages are installed correctly.
pip version
24.3.1
Python version
3.11
OS
Ubuntu
How to Reproduce
Or:
Output
Output: https://gist.github.com/Conchylicultor/741379767180cb09a85b4433958719f6
The
.[docs]
only installsphinx-apitree[ext]
: https://github.com/google-research/kauldron/blob/d409d54e9bfb9e5e5f2f2c70946ff7783dd098ca/pyproject.toml#L78If I install
pip install sphinx-apitree[ext]
directly, it's working. So not sure why pip fail to install when the same package is installed insideproject.optional-dependencies
Code of Conduct
The text was updated successfully, but these errors were encountered: