pip: New resolver error message is confusing if a package has inconsistent dependencies

Given this package:

# setup.py
from setuptools import setup
setup(
    name='testpkg',
    version='1',
    # virtualenv==20.0.25 requires six>=1.9.
    install_requires=['six<1.9', 'virtualenv==20.0.25'],
)

This produces the following error message:

ERROR: Cannot install testpkg 1 and testpkg because these package versions have conflicting dependencies.

The conflict is caused by:
    testpkg 1 depends on six<1.9
    virtualenv 20.0.25 depends on six<2 and >=1.9.0

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/stable/user_guide/#dependency-conflicts-resolution-impossible

testpkg shows up twice in the first ERROR: message, which looks confusing. It is “correct” that testpkg is conflicting with itself, but we probably need to produce a message that makes more sense to humans.

cc @nlhkabu @pfmoore

Note: I don’t think this should block beta since this kind of packages is already broken, and likely to be relatively rare. And the message is not that bad either; everything after the first line still makes sense in this situation.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 22 (22 by maintainers)

Most upvoted comments

New issue opened to look at adding dep tree to error message: https://github.com/pypa/pip/issues/9036

Note: if we update the error messages here, we will also need to update the documentation

Well, if it’s two top-level dependencies, it’s within the user’s control and the message above makes sense. If either one or both are sub-dependencies, it’s out of the users control, but we could maybe guide them towards communicating with the project’s maintainers instead.

I was actually thinking maybe we could get away with simply not showing a package name multiple times.