import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/fancy/.pyenv/versions/env362/lib/python3.6/site-packages/MySQLdb/__init__.py", line 18, in <module>
import _mysql
ImportError: dlopen(/Users/fancy/.pyenv/versions/env362/lib/python3.6/site-packages/_mysql.cpython-36m-darwin.so, 2): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /usr/local/opt/mysql/lib/libmysqlclient.21.dylib
Reason: image not found
原因:由于升级了最新的openssl@1.1后找不到libssl.1.0.0.dylib
解决方法:从别的目录下find / -name libssl.1.0.0.dylib 把找到的这个文件复制到/usr/local/opt/openssl/lib/这个目录下就可以了