Reference only

Protobuf Descriptors cannot be created directly: identify the generated code's owner

Older generated Python message code can conflict with its runtime. Locate the package carrying that code before changing every Protobuf consumer in the environment.

Scope and symptoms

Older generated Python message code can conflict with its runtime. Locate the package carrying that code before changing every Protobuf consumer in the environment.

Search fragments; wording and context vary:

Descriptors cannot be created directly

Source-supported context

Protobuf's 2022 Python update documents the upb-based 4.21 line and its generated-code requirements. That compatibility context is version-specific, not a universal explanation for every current deserialization error. V04-PROTOBUF

Distinguish these cases

1. A dependency includes older _pb2.py files that do not match the installed runtime.

2. A wrapper copied generated code from a different project or revision.

3. A field, data or unrelated interface failure is being grouped with this error merely because Protobuf appears in the stack.

Suggested diagnostic sequence

This sequence is editorial guidance, not a diagnosis of your machine.

1. Preserve the traceback and locate the first relevant generated file or third-party package. Record that package, protobuf and node versions rather than sharing only the final line.

2. Prefer a maintained release of the producer that supplies compatible generated code. Do not hand-edit generated files to suppress the exception.

3. For your own definitions, regenerate with the project's supported compiler/runtime combination and test it. For a third-party dependency, use its maintained fix or isolate an explicitly supported legacy combination.

4. Test minimal serialization and the original node, then regress other Protobuf consumers. Record any temporary implementation switch or version constraint together with a rollback plan.

Completion checks

Generated code loads under the chosen runtime, real message handling and the node call succeed, and related consumers remain consistent.

Limits and cautions

No universal protobuf==3.20.* downgrade or environment-variable workaround is prescribed. No user protocol files or models were executed during this documentation work.

Source review: 2026-09-22. No installation, GPU inference or user-environment repair was executed.

Original sources

Didn't solve it?

Check the next possible cause

The same symptom can come from a different cause. Work through these related entries in order.

  1. ModuleNotFoundError in ComfyUI even though the package is installedModuleNotFoundErrorA successful installation in a terminal does not show that ComfyUI uses the same Python. Separate the import name, distribution name and running interpreter before changing dependencies.
Paste your full log into the error finder

Was this page helpful?

Anonymous. Only a yes/no counter is stored; no account, IP address or device details.

Sources & references

Source-based editorial draft; no runtime verification. Version observations are scoped, and unknown wrapper identity is explicit.

01Protobuf Python update of 2022-05-06Source checked: 2026-09-22

Report an issue · 71c03172-b04f-5784-8cae-07f4981ec445