ModuleNotFoundError:安装mysqlclient后没有名为“ MySQLdb”的模块错误

时间:2020-08-01 11:43:54

标签: python mysql-python

(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

0 个答案:

没有答案