python3.8报错ModuleNotFoundError: No module named 'M

Python3.8 error ModuleNotFoundError: No module named'MySQLdb' and solutions

wrong reason:

MySQLdb only supports Python2. It does not yet support 3. You can use PyMySQL instead
1. Install PyMySQL command:

pip install PyMySQL

2. Under the project directory init import pymysql module .py file

import  pymysql

pymysql.install_as_MySQLdb()

Guess you like

Origin blog.51cto.com/14234228/2547712