Solution after pip upgrade fails

After failing to upgrade pip in the cmd command interface, pip can't be used. It
shows ModuleNotFoundError: No module named'pip._internal.cli'
This pit has been stepped on countless times, and the solution only needs two steps.
1. Execute the first command first. python -m ensurepip
Insert picture description here
When it prompts Successfully installed …, it means the execution is successful;
2. Then execute the second commandpython -m pip install --upgrade pip
Insert picture description here

In short, only need to execute two commands in sequence to solve the problem

python -m ensurepip
python -m pip install --upgrade pip

Guess you like

Origin blog.csdn.net/qq_43811879/article/details/113828857