pip 2.7 error `sys.stderr.write(f"ERROR: {exc}")`

You have local pip installed.

Remove it with

sudo rm /usr/local/bin/pip

and retry.

You can reinstall the pip by

sudo apt-get install --reinstall python-pip