TypeError: Descriptors cannot not be created directly. If this call came from a _pb2.py file……

这篇具有很好参考价值的文章主要介绍了TypeError: Descriptors cannot not be created directly. If this call came from a _pb2.py file……。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

问题描述

TypeError: Descriptors cannot not be created directly. If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0. If you cannot immediately regenerate your protos, some other possible workarounds are:
1. Downgrade the protobuf package to 3.20.x or lower.
2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates

解决方案

pip uninstall protobuf
pip install protobuf==3.20.1

引用参考

https://github.com/protocolbuffers/protobuf/issues/10051文章来源地址https://www.toymoban.com/news/detail-704196.html

到了这里,关于TypeError: Descriptors cannot not be created directly. If this call came from a _pb2.py file……的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Could not build wheels for opencv-python which use PEP 517 and cannot be installed directly

    当我们运行代码要运用到cv2库时,提示我们没有安装cv2,而直接用pip install opencv-python下载却显示下载失败: Could not build wheels for opencv-python which use PEP 517 and cannot be installed directly 直接运用conda安装: 随后完成cv2的安装。

    2024年02月10日
    浏览(26)
  • Could not build wheels for opencv-python-headless which use PEP 517 and cannot be installed directly

    笔者是python环境下安装 albumentations 出现的,该库经常用于图像增强,在cv领域有很大的知名度。在使用下边的命令进行安装后 就报了 ERROR:Could not build wheels for opencv-python-headless which use PEP 517 and cannot be installed directly 。 albumentations库依赖opencv,在直接使用pip命令安装时,albumen

    2024年02月15日
    浏览(49)
  • ERROR: Could not build wheels for opencv-python which use PEP 517 and cannot be installed directly

    pip install --upgrade -r requirements.txt -i https://mirror.baidu.com/pypi/simple Looking in indexes: https://mirror.baidu.com/pypi/simple Collecting prettytable Downloading https://mirror.baidu.com/pypi/packages/5f/ab/64371af206988d7b15c8112c9c277b8eb4618397c01471e52b902a17f59c/prettytable-3.3.0-py3-none-any.whl (26 kB) Collecting ujson Downloading https://

    2024年01月22日
    浏览(49)
  • git fatal: ‘xxx‘ is not a commit and a branch ‘xxx‘ ‘ cannot be created from it

    当拉取一个git远程仓库分支时报错: 命令:git checkout -b 本地分支名 远程分支名 报错:fatal: \\\'origin/dev_v2.8.4_v10.74.1\\\' is not a commit and a branch \\\'dev_v2.8.4_v10.74.1\\\' cannot be created from it 远程新建的分支没有更新到本地。实际上,git仓库分为本地仓库和远程仓库,我们用 checkout 命令是从本

    2024年02月10日
    浏览(34)
  • 【Git报错】fatal: ‘origin/XXX‘ is not a commit and a branch ‘XXX‘ cannot be created from it

    发现问题 远程已有分支,本地需要新建对应分支,于是执行命令: git checkout --track origin/XXX 时报错。 原因: 远程真的没有这个分支,所以失败 这个情况没什么好说的 远程有这个分支,但是本地认为远程没有这个分支 执行如下命令,查看本地缓存的所有远程分支,看看你要

    2024年02月16日
    浏览(37)
  • git拉取远程分支到本地报错fatal: ‘origin/XXX‘ is not a commit and a branch ‘XXX‘ cannot be created from it

    远程已有分支,本地需要新建对应分支,报下面错误 原因: 远程真的没有这个分支,所以失败 远程有这个分支,但是本地认为远程没有这个分支 执行 git branch -r 命令,查看本地缓存的所有远程分支 输出显示远程并没有要拉取的分支,但是实际上远程仓库是有该分支的,从

    2024年02月15日
    浏览(35)
  • 【前端】报错TypeError: Cannot create property ‘xxx‘ on string ‘xxx‘

    报错原因分析:赋值的类型错误 前端在遍历时通过判断条件为数据添加属性时报错,在重新查看代码时发现为遍历语句错误。 for (let item in list) {} for (let item of list) {} 二者的不同之处在于,前者在遍历数组时若数组下存在属性,则会对属性也进行遍历操作,故报赋值的类型错

    2024年02月09日
    浏览(35)
  • SQLIntegrityConstraintViolationException: Column ‘create_time‘ cannot be null

    在使用MySQL + MyBatis时遇到的问题,记录一下。 在测试环境里,往MySQL数据表里插入数据时报错: SQLIntegrityConstraintViolationException: Column \\\'create_time\\\' cannot be null 表结构字段定义: 备注: MySQL数据库版本: 使用的MyBatis版本: 使用的MySQL驱动版本: 参考mysql-insert-error-cannot-be-null-

    2024年02月01日
    浏览(53)
  • [Vue warn]: Error in created hook: “TypeError: Cannot read properties of undefined (reading ‘$on‘)“

    vue实现 兄弟进程 间的通信。 我想实现VUE中兄弟组件的通信,除了VueX之外,还可以使用eventBus,这几个教程把eventbus讲的很详细。 (34条消息) Vue 兄弟组件之间的通信_coffee豆丿的博客-CSDN博客_兄弟组件 大部分教程都是这样,我看了一个小时的教程。但是,我按照他们的代码去

    2023年04月09日
    浏览(36)
  • TypeError: this.getOptions is not a function 的解决

     一、问题的出现: 在进行  React  / vue项目开发的时候,出现了这个错误: TypeError: this.getOptions is not a function ,如下所示:  二、问题的分析:         这个实际上就是 sass-loader 的版本过高或过低,与当前node版本不对应,不兼容 getOptions 函数方法,所以需要对 sass-loa

    2024年02月12日
    浏览(39)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包