protobuf3 is a separate package, unrelated to the Google release of protobuf.
The regular Google release of protobuf python (--python_out=.) should work with Python 3. On Sunday, December 24, 2017 at 8:18:29 PM UTC-8, Delvin Pan wrote: > > Hi All, > > I have been using protobuf3 for a while and it works most of time, until I > try to use package google.protobuf.timestamp. > > Here is the problems: > > os : ubuntu 16.04 > > protoc installment : follwing the instruments in > https://gist.github.com/sofyanhadia/37787e5ed098c97919b8c593f0ec44d8 > > python protobuf3 installment: sudo pip3 install protobuf3 > > test code: protobuftest.proto in the attachment > > cmd to run: > > protoc -I=. --python3_out=. protobuftest.proto > > Result: > > Traceback (most recent call last): > File "/usr/local/bin/protoc-gen-python3", line 36, in <module> > compiler = Compiler(desc_map[file_name], top_level_elements) > File > "/usr/local/lib/python3.5/dist-packages/protobuf3/compiler/__init__.py", > line 54, in __init__ > self.process_message(message) > File > "/usr/local/lib/python3.5/dist-packages/protobuf3/compiler/__init__.py", > line 104, in process_message > self.process_field(message.name, field, embedded) > File > "/usr/local/lib/python3.5/dist-packages/protobuf3/compiler/__init__.py", > line 148, in process_field > file_to_import = > splitext(self.__tle_map[top_level_name])[0].replace('/', '.') > KeyError: 'google' > --python3_out: protoc-gen-python3: Plugin failed with status code 1. > > Thanks a lot for your help. > > best > Delvin > > > > > -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
