用python3.8出现问题,问一下除了降级还有什么方法吗

fboy

2 回复22 浏览

来自课程:快速入门Unity机器学习(mlagent)

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

全部回复(2)

  • 老师_maimai 1 楼

    报错上说了,翻译过来就这几个方法

    1. 降级protobuf包:可以尝试将protobuf包降级到3.20.x或更低的版本。需要卸载当前版本

    2. 作为临时解决方法,你可以设置环境变量PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION为"python"。

     

     

  • fboy 楼主 2 楼

    嗯,谢谢老师

     

发表回复

登录后可以回复