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

后端 未结 1 570
我在风中等你
我在风中等你 2021-02-10 02:22

I am following the django tutorial, Many have asked the question but I think my situation is bit unique because after installing python-mysql I still get this error when I try t

1条回答
  •  佛祖请我去吃肉
    2021-02-10 02:37

    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.

    0 讨论(0)
提交回复
热议问题