(venv1) ➜ Disk_Alg python main.py
Traceback (most recent call last):
File "main.py", line 3, in <module>
from service import data_service
File "/Users/jason/JasonProject/Python/Disk_Alg/service/data_service.py", line 4, in <module>
from dao import mysql_dao as mysql
File "/Users/jason/JasonProject/Python/Disk_Alg/dao/mysql_dao.py", line 1, in <module>
import MySQLdb
ModuleNotFoundError: No module named 'MySQLdb'
- 有一个错误通知
no module named mysqldb
,我已经在ven1中pip安装了mysqlclient
- 我可以成功导入MySQLdb,并且已经使用
pip install mysql-connector-python
在操作系统解释器中安装了mysql
- 版本os:mac 10.15,python:3.7.3,MySQL:8.0.21,MySQLclient:2.0.1,mysql-connector-python 8.0.21