If you wrote
pip install --upgrade pip
and you got
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.2.1
Uninstalling pip-20.2.1:
ERROR: Could not install packages due to an EnvironmentError...
then you have uninstalled pip instead install pip. This could be the reason of your problem.
The Gorodeckij Dimitrij's answer works for me.
python -m ensurepip