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

前端 未结 23 1247
夕颜
夕颜 2020-12-02 10:51

The problem Im facing while trying to connect to database for mysql. I have also given the database settings that i have used.

 Traceback (most recent call l         


        
23条回答
  •  长情又很酷
    2020-12-02 11:43

    if the error looks like this

    django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module:
    dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/_mysql.so, 2): Library not loaded: 
    /usr/local/opt/mysql/lib/libmysqlclient.20.dylib
    Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/_mysql.so
    

    then try :

    pip install python-mysqldb
    

提交回复
热议问题