我的python安装已损坏,在尝试使用pip时看到md5/sha1错误

我的python安装已损坏,在尝试使用pip时看到md5/sha1错误,python,pip,ansible,homebrew,Python,Pip,Ansible,Homebrew,我不确定发生了什么,但突然我的python安装似乎出了问题。 如果我键入pip,我会看到: ERROR:root:code for hash md5 was not found. Traceback (most recent call last): File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in &l

我不确定发生了什么,但突然我的python安装似乎出了问题。 如果我键入pip,我会看到:

ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
但是如果我键入pip,我仍然会看到相同的错误,因此上面的命令似乎没有指向python3

pip3工作正常

我怎样才能解决这个问题,让pip工作

>python --version
Python 2.7.16
pip不起作用,但python起作用

我以前使用过ansible,现在ansible自动完成不起作用了,我猜这个库不起作用了,因为我的python设置已经被破坏了

自制软件说我应该安装3.7.7:

brew info python
python: stable 3.7.7 (bottled), HEAD
Interpreted, interactive, object-oriented programming language
https://www.python.org/
/usr/local/Cellar/python/3.7.7 (4,011 files, 61.2MB)
  Poured from bottle on 2020-03-19 at 09:35:48
我在OSX 10.13.6上

brew info python
python: stable 3.7.7 (bottled), HEAD
Interpreted, interactive, object-oriented programming language
https://www.python.org/
/usr/local/Cellar/python/3.7.7 (4,011 files, 61.2MB)
  Poured from bottle on 2020-03-19 at 09:35:48