Looks like they have removed support for Python 2.7 with the latest version of Pip.
https://lwn.net/Articles/843945/
If I pin the pip version to 20.3.4, it works fine.
Answer from Lakshmi Prabha Enjeti on Stack OverflowUnable to upgrade Pip on Python 2.7.5 - Stack Overflow
How do I install pip for python 3.7.11 on CentOS 7 - Stack Overflow
upgrade pip and error on centOS7 - Stack Overflow
python - How do I install pip on CentOS? - Unix & Linux Stack Exchange
Looks like they have removed support for Python 2.7 with the latest version of Pip.
https://lwn.net/Articles/843945/
If I pin the pip version to 20.3.4, it works fine.
I have upgraded my pip to 20.3.4 version using this command. If you decited to stay on Python2.7 so you can upgrade your pip till 20.3.4
sudo python2.7 -m pip install --upgrade pip==20.3.4
Summarised from another site:
Core package repositories for CentOS 7 does not have python-pip. For that you need to enable an EPEL ("Extra Packages for Enterprise Linux") repository. You do that with
sudo yum install epel-release
After that, you should be able to install pip with
sudo yum install python-pip
Also possibly related:
- How to install pip in CentOS 7? (on StackOverflow, old)
- Recommended way to install pip(3) on centos7 (on StackOverflow, newer)
In particular, one answer there states that
Since Python 3.5,
pipis already bundled with the python distribution, so you can just runpython3.6 -m pipinstead ofpip.
alternate solution:
wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py