解决TypeError: Descriptors cannot not be created directly报错!
完整报错如下:
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报错!相关推荐
- 已解决TypeError: Descriptors cannot not be created directly.
已解决TypeError: Descriptors cannot not be created directly. If this call came from a _pb2.py file, you ...
- 关于Descriptors cannot not be created directly报错
报错信息为: TypeError: Descriptors cannot not be created directly. If this call came from a _pb2.py file, ...
- 问题:TypeError: Descriptors cannot not be created directly.解决方法
运行代码时提示如下报错: 解决上面问题,直接在控制台中输入下面命令重新安装protobuf即可,如下: pip install 'protobuf~=3.19.0' 以上就是解决TypeError: ...
- python报错系列一:TypeError: Descriptors cannot not be created directly.
解决TypeError: Descriptors cannot not be created directly. pip install protobuf==3.19.0 或者 pip install ...
- TypeError: Descriptors cannot not be created directly解决
文章目录 问题 解决 问题 跑代码的时候遇到了这个问题: TypeError: Descriptors cannot not be created directly. If this call cam ...
- 【TypeError: Descriptors cannot not be created directly. 】解决方法
报错信息: TypeError: Descriptors cannot not be created directly. If this call came from a _pb2.pyfile, y ...
- python TypeError: Descriptors cannot not be created directly错误解决
运行python脚本时出现错误 TypeError: Descriptors cannot not be created directly. If this call came from a _pb2 ...
- 解决:TypeError: Descriptors cannot not be created directly
我使用pip命令下载安装paddlepaddle库,具体命令如下所示,采用清华镜像源,这样下载速度更快! pip install -i https://pypi.tuna.tsinghua.edu.c ...
- TypeError: Descriptors cannot not be created directly.
python 依赖 protobuf 奇怪报错 TypeError: Descriptors cannot not be created directly. 在使用 paddlex 时引入一些调用了 ...
最新文章
- 【OpenCV 4开发详解】图像像素统计
- 0406复利计算5.0--结对
- 如何使用jquery_好程序员web前端学习路线分享jQuery学习技巧
- MySQL Study之--Percona Server版本
- OS + macOS Mojave 10.14.4 / sushi / ssh-keygen / ssh-copy-id
- knn算法python代码_在python中使用KNN算法处理缺失的数据
- vue 查看变量类型_Vue学习 开始走向VUE开发2---插值使用详解
- 你所不知道的 CSS 阴影技巧与细节
- Easyui清除tree的选中
- mybatis编写一个查询数据库表的程序
- 沉没的王国---揭秘滇东自杞国(1)
- python:BeautifulSoup解析爬取网页文章demo
- Cell:清华程功组揭示皮肤菌群的一种气味挥发物促进黄病毒感染宿主吸引蚊虫...
- CST STUDIO SUITE 2022 软件下载与安装教程
- 计算机不能关机处理方法,电脑无法关机的解决办法
- 阿里云80 端口别阿里云盾占用
- 用ZBrush做游戏建模,3D打印,手办模型、珠宝设计等
- ps的两种填充效果快捷键
- [WC2021] 斐波那契——数论、斐波那契数列
- SSM三大框架整合(Spring+SpringMVC+MyBatis)