Table of Contents

How To Fix Error 'django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.'

I encountered this error while running Django command but you might get this with many different commands.

python migrate
Error loading MySQLdb module

Make sure you have gcc installed first...

Install gcc

sudo yum install gcc

How to Fix MySQLdb module error on python2

Check out the version of python that you are using. If you are using python2, then install following libraries...

sudo yum install python-devel mysql-devel
pip install mysqlclient

How to Fix MySQLdb module error on python3

For python3.4 do following...

sudo yum install python34-devel mysql-devel
pip install mysqlclient

For python3.6 do following...

yum install python36-devel mysql-devel
pip install mysqlclient

Related Posts