Error No module named MySQLdb

691    Asked by ChrisEVANS in Python , Asked on Jul 14, 2021

I am using Python version 3.8.3 and install MySQL version 5.0 and Django. Django is working fine with Python, but not MySQL.

How to fix this error?

Answered by Coleman Garvin

 Try this code:

pip install PyMySQL

and then add this two lines to your Project/Project/init.py

import pymysql

pymysql.install_as_MySQLdb()

Hope this will resolve importerror: no module named 'mysqldb'.



Your Answer

Interviews

Parent Categories