由于Python多版本共存,难免会导致SSL出错。异常现象如下:

>>> import _ssl
>>> _ssl
<module '_ssl' from '/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload/_ssl.cpython-37m-darwin.so'>

这时我们只需要修复Python版本便可。处理方式如下:

brew reinstall python