完整报错如下:

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

解决方案:

首先看了网上的大佬说要将protobuf更换成较低的版本

pip uninstall protobuf
pip install protobuf==3.20.0

如果安装速度慢可以采用镜像源

pip uninstall protobuf
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple protobuf==3.20.0

但是一顿操作之后,在pycharm上面还是报错

这个时候,网络上搜到的资料都没办法解决了

于是我继续摸索

发现虽然系统protobuf包虽然已经降级为3.20.0

但pycharm的protobuf包还是在最新的版本!

于是将protobuf包在pycharm中重新卸载安装,选择3.20.0版本或更低

注意:如果此处没有版本的更多信息,无法安装其他版本

可以通过配置更多 镜像源解决! 

(新版本在python packages中的设置按钮中) (忽略我起的奇怪的名字XD)

安装完成

运行一下

芜湖搞定!bug清除!

解决TypeError: Descriptors cannot not be created directly报错!相关推荐

  1. 已解决TypeError: Descriptors cannot not be created directly.

    已解决TypeError: Descriptors cannot not be created directly. If this call came from a _pb2.py file, you ...

  2. 关于Descriptors cannot not be created directly报错

    报错信息为: TypeError: Descriptors cannot not be created directly. If this call came from a _pb2.py file, ...

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

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

  4. python报错系列一:TypeError: Descriptors cannot not be created directly.

    解决TypeError: Descriptors cannot not be created directly. pip install protobuf==3.19.0 或者 pip install ...

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

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

  6. 【TypeError: Descriptors cannot not be created directly. 】解决方法

    报错信息: TypeError: Descriptors cannot not be created directly. If this call came from a _pb2.pyfile, y ...

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

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

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

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

  9. TypeError: Descriptors cannot not be created directly.

    python 依赖 protobuf 奇怪报错 TypeError: Descriptors cannot not be created directly. 在使用 paddlex 时引入一些调用了 ...

最新文章

  1. 【OpenCV 4开发详解】图像像素统计
  2. 0406复利计算5.0--结对
  3. 如何使用jquery_好程序员web前端学习路线分享jQuery学习技巧
  4. MySQL Study之--Percona Server版本
  5. OS + macOS Mojave 10.14.4 / sushi / ssh-keygen / ssh-copy-id
  6. knn算法python代码_在python中使用KNN算法处理缺失的数据
  7. vue 查看变量类型_Vue学习 开始走向VUE开发2---插值使用详解
  8. 你所不知道的 CSS 阴影技巧与细节
  9. Easyui清除tree的选中
  10. mybatis编写一个查询数据库表的程序
  11. 沉没的王国---揭秘滇东自杞国(1)
  12. python:BeautifulSoup解析爬取网页文章demo
  13. Cell:清华程功组揭示皮肤菌群的一种气味挥发物促进黄病毒感染宿主吸引蚊虫...
  14. CST STUDIO SUITE 2022 软件下载与安装教程
  15. 计算机不能关机处理方法,电脑无法关机的解决办法
  16. 阿里云80 端口别阿里云盾占用
  17. 用ZBrush做游戏建模,3D打印,手办模型、珠宝设计等
  18. ps的两种填充效果快捷键
  19. [WC2021] 斐波那契——数论、斐波那契数列
  20. SSM三大框架整合(Spring+SpringMVC+MyBatis)

热门文章

  1. SqlServer时间、字符串相互转换
  2. 网络安全等级保护测评——主机安全(三级)详解
  3. 树莓派学习手记——制作一个空调遥控器(红外接收、发射的实现) 1
  4. android浮浮窗广告实现,浮窗广告的实现原理
  5. fiddler抓包常用功能
  6. 公司考勤系统设计文件
  7. bilibili视频列表名字太长显示不全的解决方法
  8. 前端向后端传递参数方式 - 表单序列化
  9. 通过mongodump备份单个数据库
  10. 设置Tablayout 文字和下划线宽度一样