File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
src/pip/_internal/resolution/resolvelib Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -711,6 +711,13 @@ def _report_single_requirement_conflict(
711
711
712
712
return DistributionNotFound (f"No matching distribution found for { req } " )
713
713
714
+ def _has_any_candidates (self , project_name : str ) -> bool :
715
+ """
716
+ Check if there are any candidates available for the project name.
717
+ """
718
+ candidates = self ._finder .find_all_candidates (project_name )
719
+ return any (not c .link .is_yanked for c in candidates )
720
+
714
721
def get_installation_error (
715
722
self ,
716
723
e : ResolutionImpossible [Requirement , Candidate ],
@@ -796,6 +803,22 @@ def describe_trigger(parent: Candidate) -> str:
796
803
spec = constraints [key ].specifier
797
804
msg += f"\n The user requested (constraint) { key } { spec } "
798
805
806
+ # Check for causes that had no candidates
807
+ causes = set ()
808
+ for req , _ in e .causes :
809
+ causes .add (req .name )
810
+
811
+ no_candidates = {c for c in causes if not self ._has_any_candidates (c )}
812
+ if no_candidates :
813
+ msg = (
814
+ msg
815
+ + "\n \n "
816
+ + "Some conflict cause(s) have no "
817
+ + "available versions for your environment:"
818
+ + "\n "
819
+ + "\n " .join (sorted (no_candidates ))
820
+ )
821
+
799
822
msg = (
800
823
msg
801
824
+ "\n \n "
You can’t perform that action at this time.
0 commit comments