File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -788,11 +788,19 @@ def __init__(
788
788
package : "AlreadyInstalledCandidate" ,
789
789
invalid_req_exc : "InvalidRequirement" ,
790
790
) -> None :
791
+ installed_location = package .dist .installed_location
791
792
super ().__init__ (
792
793
message = Text (
793
- f"Cannot uninstall { package } because it has an invalid requirement:\n "
794
- f"{ invalid_req_exc .args [0 ]} ."
794
+ f"Cannot process installed package { package } "
795
+ + (f"in { installed_location !r} " if installed_location else "" )
796
+ + f"because it has an invalid requirement:\n { invalid_req_exc .args [0 ]} "
797
+ ),
798
+ context = (
799
+ "Starting with pip 24.1, packages with invalid "
800
+ "requirements can not be processed."
801
+ ),
802
+ hint_stmt = (
803
+ "To proceed this package must be uninstalled using 'pip<24.1', "
804
+ "some other Python package tool, or manually deleted."
795
805
),
796
- context = "Since pip 24.1+ invalid requirements can not be read by pip." ,
797
- hint_stmt = "Please use 'pip<24.1' if you need to uninstall this package." ,
798
806
)
You can’t perform that action at this time.
0 commit comments