编程语言
首页 > 编程语言> > python protobuf error class DescriptorBase(metaclass=DescriptorMetaclass) SyntaxError: invalid synta

python protobuf error class DescriptorBase(metaclass=DescriptorMetaclass) SyntaxError: invalid synta

作者:互联网

Error

  File "/root/xxx/xxx/xxx/xxx.py", line 6, in <module>
    from google.protobuf import descriptor as _descriptor
  File "/usr/lib/python2.7/site-packages/google/protobuf/descriptor.py", line 117
    class DescriptorBase(metaclass=DescriptorMetaclass):
                                  ^
SyntaxError: invalid syntax

https://github.com/protocolbuffers/protobuf/issues/9045

解决

pip install protobuf==3.17.3

 

标签:google,protobuf,python,SyntaxError,xxx,syntax,descriptor
来源: https://www.cnblogs.com/Primzahl/p/16392682.html