Skip to content

v1.12.* should require protobuf >=6.31.1 #68

Open

Description

@kho

Activity

  1. kho commented on Jun 22, 2026

    @kho
    Author

    Copied here for better visibility:

    (Regarding _PROTOBUF_VERSION = "6.31.1" in WORKSPACE)

    This bump in protobuf version is not reflected in https://github.com/tensorflow/metadata/blob/master/setup.py#L139. As a result, pip might install an older version of protobuf (e.g. required by an older version of tensorflow) and the latest version of tensorflow-metadata, which results in an import time failure.

    Here's an example for reproducing the problem:

    #!/bin/bash -e
    mkdir /tmp/test_meta
    cd /tmp/test_meta
    uv venv --python=3.12
    uv pip install tensorflow==2.18 tensorflow-metadata
    uv run python -c 'from tensorflow_metadata import proto'
    

    This will now install protobuf==5.29.6 (required by tensorflow==2.18.0) and lead to the following error:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/test_meta/.venv/lib/python3.12/site-packages/tensorflow_metadata/proto/__init__.py", line 16, in <module>
        from tensorflow_metadata.proto.v0 import (
      File "/tmp/test_meta/.venv/lib/python3.12/site-packages/tensorflow_metadata/proto/v0/anomalies_pb2.py", line 12, in <module>
        _runtime_version.ValidateProtobufRuntimeVersion(
      File "/tmp/test_meta/.venv/lib/python3.12/site-packages/google/protobuf/runtime_version.py", line 100, in ValidateProtobufRuntimeVersion
        _ReportVersionError(
      File "/tmp/test_meta/.venv/lib/python3.12/site-packages/google/protobuf/runtime_version.py", line 50, in _ReportVersionError
        raise VersionError(msg)
    google.protobuf.runtime_version.VersionError: Detected incompatible Protobuf Gencode/Runtime versions when loading tensorflow_metadata/proto/v0/anomalies.proto: gencode 6.31.1 runtime 5.29.6. Runtime version cannot be older than the linked gencode version. See Protobuf version guarantees at https://protobuf.dev/support/cross-version-runtime-guarantee.
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions