I have the same problem on macOS. I guess my problem is because my python@2 was installed by homebrew.
Searched and tried many ways. Here is what works for me, and for your reference if you also happen to use homebrew on macOS.
I. Use default python on macOS
Step1. brew uninstall python@2
Step2. sudo /usr/bin/easy_install pip
Step3. cd HOMBREW_BIN_PATH
Step4. ln -sf /usr/bin/python python
Step5. ln -sf /usr/local/bin/pip pip
Then you can use pip as usual.
II. A workaround with non-https source instead
Refers to: https://blog.51cto.com/tenderrain/1956752
Suppose here we use non-https source of mirrors.aliyun.com
, and want to install six
Method1. Directly by CLI
pip install -i http://mirrors.aliyun.com/pypi/simple six --trusted-host mirrors.aliyun.com
Method2. Create a ~/.pip/pip.conf
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
Then use pip install six
as usual.