ModuleNotFoundError: No module named ‘MySQLdb’

When running migration for a Django application with “python manage.py migrate”, I got the following error message

ModuleNotFoundError: No module named 'MySQLdb'

To fix install

pip install mysqlclient

This will require MySQL development package. On the Ubuntu server running MariaDB, I installed packaged libmariadb-dev

Advertisement

sudo apt install libmariadb-dev
Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement