`ResolutionImpossible` error message does not distinguish between extras
See original GitHub issueDescription
If a package has extras with conflicting dependencies, the error message displayed by pip does not clarify which extras triggered the conflict, and also produces an error message with is rather confusing. Example (see steps to reproduce):
The conflict is caused by:
resolution-impossible-with-extras[extra1,extra2,extra3] 0.0.0 depends on pandas<2 and >=1.3
resolution-impossible-with-extras[extra1,extra2,extra3] 0.0.0 depends on pandas==1.4.1
This happens when extra1
asks for pandas==1.4.0
and extra2
asks for pandas==1.4.1
. extra3
has nothing to do with the conflict, but from the error message it’s impossible to tell. In addition, the error message never mentions neither which extras that caused the issue, nor the actual issue, as pandas==1.4.0
is never mentioned.
Expected behavior
It should point to the extras that triggered the ResolutionImpossible
error in a clear way.
pip version
22.0.2
Python version
3.9
OS
Ubuntu 21.10
How to Reproduce
Create a setup.cfg
with the following content:
[metadata]
name = resolution_impossible_with_extras
[options]
install_requires =
pandas >=1.3, <2
[options.extras_require]
extra1 =
pandas==1.4.0
extra2 =
pandas==1.4.1
extra3 =
numpy==1.22.1
and an “empty” setup.py
like the following content:
from setuptools import setup
setup()
Then execute in the same folder:
pip install .[extra1,extra2,extra3]
Output
Processing /path/to/folder/resolution-impossible-with-extras/package
Preparing metadata (setup.py) ... done
Requirement already satisfied: pandas<2,>=1.3 in /path/to/folder/resolution-impossible-with-extras/venv/lib/python3.9/site-packages (from resolution-impossible-with-extras==0.0.0) (1.4.0)
ERROR: Cannot install resolution-impossible-with-extras[extra1,extra2]==0.0.0 because these package versions have conflicting dependencies.
The conflict is caused by:
resolution-impossible-with-extras[extra1,extra2,extra3] 0.0.0 depends on pandas<2 and >=1.3
resolution-impossible-with-extras[extra1,extra2,extra3] 0.0.0 depends on pandas==1.4.1
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
Code of Conduct
- I agree to follow the PSF Code of Conduct.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (6 by maintainers)
Top GitHub Comments
Run it several times.
If anyone’s interested in improving this, see also #9237.