Mysqldb is not compatible with versions later than python3.5
Mysqldb
python3.5
Use pymysql instead of MySQLdb Add this code at the beginning of the .py file
pymysql
import pymysql pymysql.version_info = (1, 4, 13, "final", 0) pymysql.install_as_MySQLdb()