For macOS X
, this problem happened to me after I upgraded my homebrew,
What really worked for me is this,
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
then
python get-pip.py
according to the discussion in the reference, it seems only pip version 21.1.1
fixed the problem.
Refer to the following discussion
https://github.com/pypa/pip/issues/7217