【发布时间】:2020-10-13 15:54:30
【问题描述】:
我已成功下载 MySQL 连接器/Python。我在 Python 的 shell 中使用了以下代码来测试我的连接:import mysql.connector
我收到以下错误消息:
没有名为“mysql.connector”的模块; 'mysql' 不是一个包。
我已经尝试通过以下方式安装 mysql.connector:
C:\Users\HP>pip install mysql-connector-python
这也不行
【问题讨论】:
-
执行
pip install mysql-connector-python时遇到什么错误?你的 python 版本是什么? -
你是否在顶部的python文件中导入了
import mysql.connector?