Categories
Python Answers

How to fix no module named MySQLdb error with Python Django?

Spread the love

To fix no module named MySQLdb error with Python Django, we install the mysql-python package.

To do this, we run one of:

  1. easy_install mysql-python (any OS)
  2. pip install mysql-python (any OS/ Python 2)
  3. pip install mysqlclient (any OS/ Python 3)
  4. apt-get install python-mysqldb (Ubuntu, etc.)
  5. cd /usr/ports/databases/py-MySQLdb && make install clean (FreeBSD)
  6. yum install MySQL-python (Fedora, CentOS, etc.)

to install the mysql-python package.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

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