Your syntax for importing is a bit off, see this file <https://github.com/protocolbuffers/protobuf/blob/main/python/google/protobuf/internal/well_known_types_test.py> for an example of how to use well known types. The implementation of our well known types is internal since it is an implementation detail that users should not edit.
On Sunday, May 22, 2022 at 4:38:47 PM UTC-7 [email protected] wrote: > Hello, > > I just upgraded protobuf from 3.17.3 to 3.20.1 (macos, python 3.9), and my > code started complaining that there is no > *from google.protobuf.empty_pb2 import Empty* > *from google.protobuf.timestamp_pb2 import Timestamp* > > I checked the package folder under > ./venv/lib/python3.9/site-packages/google/protobuf/ and indeed there is no > *Empty* type there. > > Ok, I found *Timestamp* in internal/well_known_types.py. > Why internal? It does not make sense. > > Also cannot find *StringValue* and other wrapper types. > > Is it a known bug, or I'm missing something? > How should I construct *Empty* or *StringValue* objects now? > > > Cheers, > Alexei > > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/f623de93-3949-4ce4-9dab-a218fcb205e7n%40googlegroups.com.
