Skip to content

Improve ResolutionImpossible error message clarity#13702

Open
nishtha-agarwal-211 wants to merge 6 commits intopypa:mainfrom
nishtha-agarwal-211:fix/error-message-clarity
Open

Improve ResolutionImpossible error message clarity#13702
nishtha-agarwal-211 wants to merge 6 commits intopypa:mainfrom
nishtha-agarwal-211:fix/error-message-clarity

Conversation

@nishtha-agarwal-211
Copy link

What does this PR do?

Improves the ResolutionImpossible error message by making it clearer and more actionable for users encountering dependency resolution conflicts.

What changed?

  • Replaced Unicode bullet points with ASCII hyphens for better terminal compatibility
  • Added clearer, step-by-step guidance on how users can resolve dependency conflicts
  • Preserved existing logging and error structure

Why is this change useful?

This improves the developer experience by:

  • Making the error message easier to read across different terminals
  • Providing concrete next steps instead of generic guidance

Related issue / discussion

N/A

@notatallshaw
Copy link
Member

Thanks for your PR, I'm pretty good with this change but I'll do a more detailed review of the language when I get a moment.

Currently CI checks are failing due too long line lengths, you will need to fix this, you can run CI checks locally to assist if you want: https://pip.pypa.io/en/stable/development/getting-started/#running-linters

@nishtha-agarwal-211
Copy link
Author

Thanks for the review! I’ve fixed the line-length issues and all CI checks are now passing. Happy to make any further wording adjustments if needed.

Comment on lines +839 to +851
logger.info(msg)

return DistributionNotFound(
"ResolutionImpossible: for help visit "
"https://pip.pypa.io/en/latest/topics/dependency-resolution/"
"#dealing-with-dependency-conflicts"
"ResolutionImpossible: pip could not resolve the requested "
"dependencies.\n\n"
"This usually means you have conflicting version constraints.\n\n"
"You can try:\n"
" - loosening the range of package versions you specified\n"
" - removing package versions to allow pip to resolve the conflict\n"
" - running pip with --verbose for more details\n\n"
"See https://pip.pypa.io/en/stable/user_guide/"
"#fixing-conflicting-dependencies "
"for help."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logger.info message directly above this exception already gives a lot of this information, I think that would be a better place to put any additional information.

@nishtha-agarwal-211 nishtha-agarwal-211 force-pushed the fix/error-message-clarity branch from 144f0d2 to 1278dc7 Compare March 9, 2026 04:06
Per notatallshaw's review comment, the logger.info message directly
above the exception is a better place for additional guidance. Move
the help URL into the logged message and revert DistributionNotFound
to the original concise format.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants