pycharm运行出错

#pycharm运行出错
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

Process finished with exit code 1

我也是 今天突然就有这个问题了 吓死
然后 现在找到问题的所在了

解决方法:

在当前conda环境下

pip uninstall protobuf

然后

pip install protobuf==3.19.0

再然后就可以了

TypeError:无法直接创建描述符。
如果此呼叫来自\u pb2。py文件,生成的代码已过期,必须使用protoc>=3.19.0重新生成。
如果无法立即重新生成proto,其他一些可能的解决方法包括:
将protobuf包降级为3.20。x或更低。
设置PROTOCOL\u BUFFERS\u PYTHON\u IMPLEMENTATION=PYTHON(但这将使用纯PYTHON解析,速度会慢得多)。

我也是出现了这个错误了,试了上面的方法还是不行

请问解决了吗