Search This Blog

Saturday, October 20, 2018

How to solve the problem of "ImportError: No module named MySQLdb" in Python

You need to install mysql-python:
  • yum install MySQL-python (Linux Fedora, CentOS, RedHat)
  • apt-get install python-mysqldb (Linux Ubuntu)
  • cd /usr/ports/databases/py-MySQLdb && make install clean (FreeBSD)
See also