【发布时间】:2020-05-09 20:41:43
【问题描述】:
我正在使用 Python3,我尝试使用此命令安装 mysql.connector
pip install mysql-connector-python-rf
但是当我运行代码时,我得到 ModuleNotFoundError: No module named 'mysql'
如果我输入pip search mysql-connector-python,它会找到这个版本:
mysql-connector-python (8.0.20) - MySQL driver written in Python
INSTALLED: 8.0.20 (latest)
mysql-connector (2.2.9) - MySQL driver written in Python
beam-mysql-connector (1.8.2) - MySQL I/O Connector of Apache Beam
mysql-connector-python-dd (2.0.2) - MySQL driver written in Python
INSTALLED: 2.0.2 (latest)
mysql-connector-python-rf (2.2.2) - MySQL driver written in Python
INSTALLED: 2.2.2 (latest)
MySQL-python (1.2.5) - Python interface to MySQL
mysql-connector-repackaged (0.3.1) - MySQL driver written in Python
我错过了什么?
【问题讨论】:
-
-rf模块可能不是您想要的。尝试使用pip install mysql-connector-python安装 -
如果在python3上,你可以使用
python3-mysql.connector,更多关于stackoverflow.com/questions/32877671/…和stackoverflow.com/questions/32877671/…
标签: python mysql-connector mysql-connector-python