You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my project I use rules_proto_grpc and independenty I use protobuf. When I run my project with bazel run I get the following error:
Traceback (most recent call last):
File "/home/pjachowi/.cache/bazel/_bazel_pjachowi/837ec61bba9dc67ffa44001a7a1eb11f/execroot/_main/bazel-out/k8-fastbuild/bin/postumus/main/main.runfiles/_main/postumus/main/main_main.py", line 12, in <module>
from proto import workflow_pb2_grpc
File "/home/pjachowi/.cache/bazel/_bazel_pjachowi/837ec61bba9dc67ffa44001a7a1eb11f/execroot/_main/bazel-out/k8-fastbuild/bin/postumus/main/main.runfiles/_main/proto/workflow_py_proto_pb/proto/workflow_pb2_grpc.py", line 7, in <module>
from proto import workflow_pb2 as proto_dot_workflow__pb2
File "/home/pjachowi/.cache/bazel/_bazel_pjachowi/837ec61bba9dc67ffa44001a7a1eb11f/execroot/_main/bazel-out/k8-fastbuild/bin/postumus/main/main.runfiles/_main/proto/workflow_py_proto_pb/proto/workflow_pb2.py", line 9, in <module>
from google.protobuf import runtime_version as _runtime_version
ImportError: cannot import name 'runtime_version' from 'google.protobuf' (bazel-out/k8-fastbuild/bin/postumus/main/main.runfiles/rules_python~~pip~pypi_311_protobuf/site-packages/google/protobuf/__init__.py)
The problem stems from the fact that rules_proto_grpc relies on its own protobuf containing runtime_version.py, but my project has implicite dependency on a different version of protobuf (4.25.5) which has no runtime_version.py.
In my sys.path the protobuf 4.25.5 comes first, then protobuf from rules_proto_grpc, hence from google.protobuf import runtime_version as _runtime_version finds first protobuf 4.25.5 and fails.
Description
In my project I use rules_proto_grpc and independenty I use protobuf. When I run my project with bazel run I get the following error:
The problem stems from the fact that rules_proto_grpc relies on its own protobuf containing
runtime_version.py
, but my project has implicite dependency on a different version of protobuf (4.25.5) which has noruntime_version.py
.In my sys.path the protobuf 4.25.5 comes first, then protobuf from rules_proto_grpc, hence
from google.protobuf import runtime_version as _runtime_version
finds first protobuf 4.25.5 and fails.What is the recommended way to solve this problem?
The text was updated successfully, but these errors were encountered: