AttributeError: module ‘google.protobuf.descriptor‘ has no attribute ‘_internal_

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 19:10   1176   0

使用protobuf报错如下:

AttributeError: module 'google.protobuf.descriptor' has no attribute '_internal_create_key'
AttributeError: module 'google.protobuf.descriptor' has no attribute '_internal_create_key'

解决方案:

1. 查看protoc的版本,在命令行输入如下代码:

protoc --version

2. 查看protobuf版本:

pip show protobuf

如果两个版本不一致,那么请将两个的版本保持到一致。

可以使用如下pip安装命令对protobuf升级:

pip install --upgrade protobuf -i https://pypi.douban.com/simple

也可以到https://github.com/protocolbuffers/protobuf/releases,下载合适版本的protoc

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP