gRPC Python:意外的关键字参数 'syntax'
gRPC Python: Unexpected keyword argument 'syntax'
在更改我机器上安装的东西(测试全新安装程序)后使用 protoc
生成的 _pb2.py
文件时,我收到以下错误:
File "client.py", line 16, in <module>
from google.protobuf.field_mask_pb2 import FieldMask
File "/usr/local/my-python-local/lib/python/site-packages/google/protobuf/field_mask_pb2.py", line 22, in <module>
serialized_pb=_b('\n google/protobuf/field_mask.proto\x12\x0fgoogle.protobuf\"\x1a\n\tFieldMask\x12\r\n\x05paths\x18\x01 \x03(\tBQ\n\x13\x63om.google.protobufB\x0e\x46ieldMaskProtoP\x01\xa0\x01\x01\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3')
TypeError: __init__() got an unexpected keyword argument 'syntax'
什么给了??
此问题是由于 outdated/conflicting 安装了 protobuf
:此 "unexpected keyword argument" 错误与旧版本的 protobuf
相关 --- 2.6.2 I相信。
要解决这个问题,只需重新安装 protobuf:
pip uninstall protobuf
pip install protobuf==3.0.0b2
在更改我机器上安装的东西(测试全新安装程序)后使用 protoc
生成的 _pb2.py
文件时,我收到以下错误:
File "client.py", line 16, in <module>
from google.protobuf.field_mask_pb2 import FieldMask
File "/usr/local/my-python-local/lib/python/site-packages/google/protobuf/field_mask_pb2.py", line 22, in <module>
serialized_pb=_b('\n google/protobuf/field_mask.proto\x12\x0fgoogle.protobuf\"\x1a\n\tFieldMask\x12\r\n\x05paths\x18\x01 \x03(\tBQ\n\x13\x63om.google.protobufB\x0e\x46ieldMaskProtoP\x01\xa0\x01\x01\xa2\x02\x03GPB\xaa\x02\x1eGoogle.Protobuf.WellKnownTypesb\x06proto3')
TypeError: __init__() got an unexpected keyword argument 'syntax'
什么给了??
此问题是由于 outdated/conflicting 安装了 protobuf
:此 "unexpected keyword argument" 错误与旧版本的 protobuf
相关 --- 2.6.2 I相信。
要解决这个问题,只需重新安装 protobuf:
pip uninstall protobuf
pip install protobuf==3.0.0b2