【问题标题】:Getting error of missing protobuf while connecting MySQL to python in windows在 Windows 中将 MySQL 连接到 python 时出现缺少 protobuf 的错误
【发布时间】:2019-02-14 01:32:11
【问题描述】:

使用命令在 cmd 提示符下安装 mysql-connector 时:

pip3 install mysql-connector

说安装成功,但是报这个错误:

mysql-connector-python 8.0.15 需要protobuf>=3.0.0,不是 安装windows 8.1

我找不到正确版本的 protobuf 的安装说明,可能需要。

稍后,在pycharm using 语句中进行数据库连接时

mydb = mysql.connector.connect(host, user, passwd)

我收到了这个错误:

ModuleNotFoundError: No module named 'mysql'

知道如何进行吗?在 Windows 8.1 上使用 python 3.7

【问题讨论】:

    标签: python mysql python-3.x protocol-buffers


    【解决方案1】:

    使用 pip 安装protubuf

    pip3 install protubuf 的版本是3.6.1

    对于 mysql ImportError,对于 Python 3,包 ConfigParser 已重命名为 configparser

    为此安装configparser在安装mysql后再次使用pip

    pip3 install configparser
    

    【讨论】:

      猜你喜欢
      • 2019-07-25
      • 1970-01-01
      • 1970-01-01
      • 2019-03-08
      • 1970-01-01
      • 2019-06-05
      • 2017-08-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多