django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module:

我们两清 提交于 2019-12-03 08:26:13

My libmysqlclient.18.dylib was located in /usr/local/mysql/lib/ but my system was looking for it in /usr/lib/. I ended up creating a symbolic link of libmysqlclient.18.dylib in /usr/lib which fixed the problem.

1.) Make sure that libmysqlclient.18.dylib exists in /usr/local/mysql/lib/.

Open your shell.

sudo -s
ls /usr/local/mysql/lib/ | grep libmysqlclient.18.dylib

You should see the file:

libmysqlclient.18.dylib

If not, search your system for the location of the file:

find / -name libmysqlclient.18.dylib

2.) Create a symbolic link of libmysqlclient.18.dylib in /usr/lib

Enter the following command in your shell:

ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib

If your libmysqlclient.18.dylib file wasn't located in /usr/local/mysql/lib replace the first path with the proper path to libmysqlclient.18.dylib.

Hopefully that helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!