Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protobuf version in Python package #319

Open
ingomueller-net opened this issue Nov 27, 2024 · 2 comments
Open

Protobuf version in Python package #319

ingomueller-net opened this issue Nov 27, 2024 · 2 comments

Comments

@ingomueller-net
Copy link

I am running into the following error message when I have the Python package protobuf==5.29-rc3 (currently latest) installed:

/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/substrait_validator/__init__.py:20: in <module>
    from .substrait.plan_pb2 import Plan
/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/substrait_validator/substrait/plan_pb2.py:12: in <module>
    _runtime_version.ValidateProtobufRuntimeVersion(
/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/google/protobuf/runtime_version.py:1[20](https://github.com/substrait-io/consumer-testing/actions/runs/12048447592/job/33593087186?pr=132#step:5:21): in ValidateProtobufRuntimeVersion
    _ReportVersionError(
/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/google/protobuf/runtime_version.py:50: in _ReportVersionError
    raise VersionError(msg)
E   google.protobuf.runtime_version.VersionError: Detected mismatched Protobuf Gencode/Runtime version suffixes when loading substrait/plan.proto: gencode 5.28.3 runtime 5.29.0-rc3. Version suffixes must be the same. See Protobuf version guarantees at https://protobuf.dev/support/cross-version-runtime-guarantee.

I haven't understood all of the details but it sounds like you can't compile protobufs with one version of the compiler and then use a runtime with a different version (see docs). My preliminary conclusion is that this means that every project using protobufs needs to ship its own version of the runtime. If that is true, that would have to be done for this project as well.

Note that I can temporarily work around the problem above by installing protobuf==5.28.3; however, if my Python environment contains two Python packages that use two different versions of the Protobuf compiler, then there is no version of the protobuf package that satisfies both of their requirements.

@EpsilonPrime
Copy link
Member

It seems like the fix is to always use an older version of protoc.

@ingomueller-net
Copy link
Author

That fits a figure I vaguely remember from the protobuf docs. But shouldn't the validator then say in its dependencies that it requires a version of protobuf less or equal the one it is compiled with?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants