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?
- 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
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:
- set up a test.proto file
- use command to compile it into py file : protoc ./test.proto --python_out=./ , then come out test_pb2.py file
- include tesy_pb2 in other code
- python run the other code
- 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 .