1
protobufファイルをカスタムPythonプラグインでコンパイルする際に問題があります。AttributeError:カスタムPythonプラグインでprotobufをコンパイルするときに6つの "indexbytes"がありません
Traceback (most recent call last):
File "C:\...\my_plugin.py", line 14, in <module>
from google.protobuf.compiler import plugin_pb2 as plugin
File "C:\Python27\lib\site-packages\google\protobuf\compiler\plugin_pb2.py", line 255, in <module>
DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\034com.google.protobuf.compilerB\014PluginProtosZ\tplugin_go'))
File "C:\Python27\lib\site-packages\google\protobuf\descriptor.py", line 869, in _ParseOptions
message.ParseFromString(string)
File "C:\Python27\lib\site-packages\google\protobuf\message.py", line 185, in ParseFromString
self.MergeFromString(serialized)
File "C:\Python27\lib\site-packages\google\protobuf\internal\python_message.py", line 1062, in MergeFromString
if self._InternalParse(serialized, 0, length) != length:
File "C:\Python27\lib\site-packages\google\protobuf\internal\python_message.py", line 1084, in InternalParse
(tag_bytes, new_pos) = local_ReadTag(buffer, pos)
File "C:\Python27\lib\site-packages\google\protobuf\internal\decoder.py", line 181, in ReadTag
while six.indexbytes(buffer, pos) & 0x80:
AttributeError: 'module' object has no attribute 'indexbytes'
--my_plugin_out: protoc-gen-my_plugin: Plugin failed with status code
両方のマシンが同じPythonのバージョンがあります:2.7.12を、これは次のエラーにつながるもう一つ上のに対し、期待通りのマシン上では実行されています。
また、同じProtobufモジュールバージョン(3.2.0)と6モジュールバージョン(1.10.0)を持っていることを確認しました。
"6"モジュールが上記のコールスタックに記載されているように "decoder.py"に必要な "indexbytes"メソッドを見逃すのはなぜか分かりません。