Protobuf typeerror descriptors cannot be created directly. May 31, 2022 · TypeError: Descriptors cannot not be created directly. The error "TypeError: Descriptors cannot not be created directly" occurs because there has been a breaking change in protobuf version 4. py file, your generated code is out of date and must be regenerated with protoc >= 3. To fix this error, you can downgrade protobuf to version 3. Mar 29, 2023 · Conclusion In conclusion, if you have encountered this typeerror: descriptors cannot not be created directly the above solutions will be able to help you to solve it. 0 to requirements. Jan 15, 2023 · offchan42 changed the title TypeError: Descriptors cannot not be created directly. Jul 24, 2024 · TypeError: Descriptors cannot be created directly. txt + rebooting the app worked for me I hope it’s possible to add some test coverage to prevent this from recurring, had a really confusing/classic “but it works on my machine” moment. Jun 1, 2022 · [Error] TypeError: Descriptors cannot not be created directly. *. To solve the error, pin your protobuf version to 3. Aug 12, 2025 · PythonのTypeError: Descriptors cannot not be created directlyエラーの解決策を解説。protobufのバージョン管理でRay, TensorFlow, Kerasが動かない問題を解決 May 26, 2022 · adding protobuf~=3. x or set the environment variable to PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python. Jul 23, 2025 · To solve the TypeError: descriptors cannot be created directly error in Python follow these steps: Understand the Context of the Error: Identify where and why the error occurs. 2. How to Resolve Python Protobuf Error "TypeError: Descriptors cannot not be created directly" When working with Python libraries that utilize Google's Protocol Buffers (protobuf), you might encounter the error TypeError: Descriptors cannot not be created directly. 20. 0. May 6, 2022 · Troubleshooting steps when you get the "descriptors cannot not be created directly" message. [Information] If this call came from a _pb2. If you cannot immediately regenerate your protos, some other possible workarounds are: 1. protobuf version bug TypeError: Descriptors cannot not be created directly. 19. - protobuf version bug on Jan 15, 2023 Sep 15, 2022 · TypeError: Descriptors cannot not be created directly. Downgrade the protobuf package to 3. This typically happens when there is an incorrect attempt to the create or use a descriptor directly in the code. TypeError: Descriptors cannot not be created directly. Jan 31, 2023 · The TypeError: Descriptors cannot not be created directly is caused by a breaking change in protobuf version 4. x or lower. If this call came from a _pb2. uefo xvobhi ybqerjfv wkrhu bhrrof hvhpuwy qyrmuo cchv mhwhga rymkn