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).
时间: 2023-06-05 10:47:23 浏览: 94
Python3.x和Python2.x的区别.docx
这个错误提示表示,描述符不能直接创建。如果这个错误是来自 _pb2.py 文件,那么你生成的代码已经过时了,需要使用 protoc >= 3.19.0 重新生成。如果你暂时无法重新生成 protos,有几种可能的解决方法: 1.将 protobuf 包降级到 3.20.x 或更低版本。 2.设置protocol_buffers_python_implementation=python (但这样会使用纯 Python 解析,速度会更慢)。
阅读全文