gpt4 book ai didi

python - 如何降级protobuf

转载 作者:行者123 更新时间:2023-12-05 00:51:03 33 4
gpt4 key购买 nike

我偶然在我的 ubuntu vps 上更新了 protobuf。现在一些非常重要的 python 脚本不再工作了。速度其实并不重要。我有两个解决方案:

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 包,不确定是不是这样

或设置 PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python - 但我在哪里设置这个。在 python 脚本中?

最佳答案

使用 pip 降级 protobuf

pip install protobuf==3.20.*

这类似于 TypeError: Descriptors cannot not be created directly

关于python - 如何降级protobuf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72899948/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com