diff --git a/news/13618.bugfix.rst b/news/13618.bugfix.rst new file mode 100644 index 00000000000..6e3d6cae784 --- /dev/null +++ b/news/13618.bugfix.rst @@ -0,0 +1,2 @@ +When installing packages, pip will no longer show a misleading +error message that included extra markers such as ``; extra == "..."``. diff --git a/src/pip/_internal/resolution/resolvelib/factory.py b/src/pip/_internal/resolution/resolvelib/factory.py index 07be5693d5e..cea07888cf3 100644 --- a/src/pip/_internal/resolution/resolvelib/factory.py +++ b/src/pip/_internal/resolution/resolvelib/factory.py @@ -708,8 +708,8 @@ def _report_single_requirement_conflict( "using the '-r' flag to install the packages listed in " "requirements.txt" ) - - return DistributionNotFound(f"No matching distribution found for {req}") + req_str = str(req).partition(";")[0].strip() + return DistributionNotFound(f"No matching distribution found for {req_str}") def _has_any_candidates(self, project_name: str) -> bool: """