Skip to content

Provide more context if resolution error is caused by python version constraints #13422

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

Open
1 task done
AyanSinhaMahapatra opened this issue Jun 10, 2025 · 1 comment
Open
1 task done
Labels
C: error messages Improving error messages type: feature request Request for a new feature

Comments

@AyanSinhaMahapatra
Copy link

What's the problem this feature will solve?

Recently oneof our dependency upgrades were failing with an ResolutionImpossible error because one of the dependencies dropped support for python3.9 that we still support because it is not EOL, see pallets/click#2975.

The error message in the CI while trying to do a pip install . was:

ERROR: Cannot install None because these package versions have conflicting dependencies.

The conflict is caused by:
    commoncode 0.0.0 depends on click>=8.2.0
    The user requested (constraint) click==8.2.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 to attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

This was from aboutcode-org/commoncode#86 in the CI: https://dev.azure.com/nexB/commoncode/_build/results?buildId=16314&view=logs&j=71924f90-629a-5f64-5467-4f9bed474c97&t=c06cbbfb-e3aa-54a3-c24d-b2d0a8d1a23f

It would have been helpful if python version constraints (from the package versions) are also displayed in the
error message which makes it much easier to understand the actual reason of failure in resolution. Because the conflict is caused by message does help to pin it down, but still seems like pip is wrong somehow as the version constraints do not seem to be conflicting, but the python version is unsupported,

Describe the solution you'd like

Improve the ResolutionImpossible so show the python version constraints which causes the ResolutionImpossible error.

I would be happy to try and contribute this fix if you think it's a good idea.

Alternative Solutions

Show something in the ResolutionImpossible error message which points to the unsupported python version as the cause.

Additional context

https://dev.azure.com/nexB/commoncode/_build/results?buildId=16314&view=logs&j=71924f90-629a-5f64-5467-4f9bed474c97&t=c06cbbfb-e3aa-54a3-c24d-b2d0a8d1a23f
aboutcode-org/commoncode#86

Code of Conduct

@notatallshaw
Copy link
Member

This is similiar to #10784 and #4795. Filtering what packages are available and resolving those packages are done as two seperate steps, this is by design following the principle of seperation of concerns.

So when the resolver prints that error it is unaware that any package for that version exists, as it does not have information about packages for different versions of Python.

Pip is currently an all volunteer project, and if someone submits a high quality PR for an improvements here I would be happy to review.

@notatallshaw notatallshaw added C: error messages Improving error messages and removed S: needs triage Issues/PRs that need to be triaged labels Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: error messages Improving error messages type: feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

2 participants