MySQLdb error when running python server on MacOSX10.6

前端 未结 2 1197
甜味超标
甜味超标 2021-02-10 07:12

Running my server (python manage.py runserver) yielded this error:

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

相关标签:
2条回答
  • 2021-02-10 07:41

    It looks like you have everything installed right, but it can't find libmysqlclient. Have you tried the following?

    > sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
    > sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql
    
    0 讨论(0)
  • 2021-02-10 07:46

    Sounds like your just missing the mysql-python dependancy for mysql and Django. Don't know how you installed Django though. Use pip or easy_install to install it.

    pip install mysql-python
    

    For Django it is recommended to use PostgreSQL though, for development purposes setting up a sqlite database is much, much easier.

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