python 依赖 protobuf 奇怪报错 TypeError: Descriptors cannot not be created directly.

在使用 paddlex 时引入一些调用了 proto的三方包时报了如下错误:

import paddle.fluid as fluid

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).

在网上搜索后发现似乎是最新的包编译时出了问题,开发人员已经会在更新后修复。

解决办法

在没有发布新版本之前先降级使用吧:

pip install protobuf==3.19.0

参考链接

https://discuss.streamlit.io/t/typeerror-descriptors-cannot-not-be-created-directly/25639

TypeError: Descriptors cannot not be created directly.相关推荐

  1. python TypeError: Descriptors cannot not be created directly错误解决

    运行python脚本时出现错误 TypeError: Descriptors cannot not be created directly. If this call came from a _pb2 ...

  2. TypeError: Descriptors cannot not be created directly解决

    文章目录 问题 解决 问题 跑代码的时候遇到了这个问题: TypeError: Descriptors cannot not be created directly. If this call cam ...

  3. TensorFlow2.8.0报错TypeError: Descriptors cannot not be created directly.

    @创建于:2022.09.28 @修改于:2022.09.28 1.错误信息 Traceback (most recent call last):File "D:\PycharmProjec ...

  4. import keras时遇到的错误 TypeError: Descriptors cannot not be created directly. If this call came from a _

    问题描述 版本对应 keras 与 tensorflow 版本对应关系:https://master–floydhub-docs.netlify.app/guides/environments/ 本文 ...

  5. 09 TypeError: Descriptors cannot not be created directly.

    1.问题: import yaml ModuleNotFoundError: No module named 'yaml' yaml模块的pip工具包名称不是yaml,而是pyyaml,所以不是直接p ...

  6. 解决:TypeError: Descriptors cannot not be created directly

    我使用pip命令下载安装paddlepaddle库,具体命令如下所示,采用清华镜像源,这样下载速度更快! pip install -i https://pypi.tuna.tsinghua.edu.c ...

  7. Python报错 TypeError: Descriptors cannot not be created directly

    Python报错TypeError: Descriptors cannot not be created directly 具体错误: TypeError: Descriptors cannot no ...

  8. Python报错TypeError: Descriptors cannot not be created directly

    Python报错TypeError: Descriptors cannot not be created directly 具体错误: TypeError: Descriptors cannot no ...

  9. 问题:TypeError: Descriptors cannot not be created directly.解决方法

    运行代码时提示如下报错: 解决上面问题,直接在控制台中输入下面命令重新安装protobuf即可,如下: pip install 'protobuf~=3.19.0' 以上就是解决TypeError: ...

最新文章

  1. android检查usb广播,Android 检测USB 音频设备
  2. 添加全局函数$.extend和对象方法$.fn
  3. 软件项目管理0703:净收确认
  4. OpenGL Lighting models照明模型的实例
  5. 本地启动 Hybris 服务器调试模式后,监听在 8000 端口
  6. antix linux安装教程,antiX 19.1 发布,轻量级的桌面Linux发行版
  7. C++ 11 中的右值引用
  8. EBGP邻居抖动问题
  9. 商业大亨微信草花服务器,商业大亨2每日答题和服务器进度奖励
  10. Jlink--SWD脚位连接
  11. 【干货】私域电商崛起:2021见实私域流量白皮书高清6月版.pdf(附下载链接)...
  12. 300 秒带你吃透大数据!
  13. Script error.全面解析
  14. 建筑能源管理系统主要有什么功能?
  15. BeautifulSoup介绍
  16. asp.net毕业设计家电维修保养信息系统
  17. ETL 部署和简单的例子
  18. wordpress 插件,wordpress 采集插件,实用wordpress 插件合集
  19. 【工具】LaTeX-OCR一款免费的公式识别软件
  20. FDR土壤水分检测传感器设计方案

热门文章

  1. js的match 方法
  2. GPS定位系统(二)——Android端
  3. 2411681-88-2,Thalidomide-O-PEG4-NHS ester它与胺部分反应
  4. 概率论的学习和整理--番外7:简单的丢骰子 和 抽黑球白球问题,对比不同概率模型求解的差别。
  5. Java加密算法—凯撒加密实现以及暴力破解
  6. 雷军“小米模式”最精简总结
  7. 美颜换妆之BeautyGAN
  8. Android查询通讯录信息
  9. 你是没教养,不是性子直
  10. Flutter Provider状态管理-Consumer