Fork me on GitHub

python调用MySQLdb库,报错 “Library not loaded: libmysqlclient.18.dylib”

错误信息:

“…Library not loaded: libmysqlclient.18.dylib

Referenced from: …ython2.7/site-packages/_mysql.so
  Reason: image not found”

原因:

升级 MySQL 以后 libmysqlclient.18.dylib 变成了 libmysqlclient.20.dylib。

解决办法:

找到 mysql 的安装路径下lib的 libmysqlclient.20.dylib 建立软连接。

sudo ln -s /usr/local/mysql/lib/libmysqlclient.20.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib
posted @ 2018-05-24 10:21  削微寒  阅读(845)  评论(0编辑  收藏  举报