I reported the issue in https://github.com/protocolbuffers/protobuf/issues/8259 As it really impact my work. So I repeated it here.
I know it is an old issue and have been duplicated with the others . But I have searched related issue and tried everything I can do . I have been trapped with this issue for 2 days. Please kindly help. *What version of protobuf and what language are you using?* Version: 3.14.0 Language: Python 3.6.9 *What operating system (Linux, Windows, ...) and version?* 1. execution in Python env in Mac os 11.0.1 works fine 2. executed in Unbuntu 18.04 will reported this error TypeError: Descriptors should not be created directly, but only retrieved from their parent" message *What runtime / compiler are you using (e.g., python version or gcc version)* Language: Python 3.6.9 *What did you do?* Steps to reproduce the behavior: 1. set up a test.proto file 2. use command to compile it into py file : protoc ./test.proto --python_out=./ , then come out test_pb2.py file 3. include tesy_pb2 in other code 4. python run the other code 5. execution in Python env in Mac os 11.0.1 works fine executed in Unbuntu 18.04 will reported this error TypeError: Descriptors should not be created directly, but only retrieved from their parent" message from test import ( File "/home/jenkins/agent/workspace/QAE/test_pb2.py", line 38, in create_key=_descriptor._internal_create_key), File "/usr/local/lib/python3.6/dist-packages/google/protobuf/descriptor.py", line 718, in *new* _message.Message._CheckCalledFromGeneratedFile() TypeError: Descriptors should not be created directly, but only retrieved from their parent. *What did you expect to see* Please kindly tell me how to resolve this issue . Please please help . It really block my work and the progress of my project . -- 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/9a589c0c-86ba-492a-8d1d-e05bd4003b33n%40googlegroups.com.
