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

Need newer versions of pubsub to work with this version of protobuf #978

Merged
merged 1 commit into from
Oct 5, 2024

Conversation

ohshazbot
Copy link
Collaborator

Without these changes, mirror.py fails with:

Traceback (most recent call last):
  File "/home/john/workspace/udmi/misc/gcloud_pubsub_mirror/mirror.py", line 16, in <module>
    from google.cloud import pubsub_v1
  File "/home/john/.pyenv/versions/3.11.9/envs/udmi/lib/python3.11/site-packages/google/cloud/pubsub_v1/__init__.py", line 17, in <module>
    from google.cloud.pubsub_v1 import types
  File "/home/john/.pyenv/versions/3.11.9/envs/udmi/lib/python3.11/site-packages/google/cloud/pubsub_v1/types.py", line 28, in <module>
    from google.iam.v1 import iam_policy_pb2  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/john/.pyenv/versions/3.11.9/envs/udmi/lib/python3.11/site-packages/google/iam/v1/iam_policy_pb2.py", line 16, in <module>
    from google.iam.v1 import options_pb2 as google_dot_iam_dot_v1_dot_options__pb2
  File "/home/john/.pyenv/versions/3.11.9/envs/udmi/lib/python3.11/site-packages/google/iam/v1/options_pb2.py", line 38, in <module>
    _descriptor.FieldDescriptor(
  File "/home/john/.pyenv/versions/3.11.9/envs/udmi/lib/python3.11/site-packages/google/protobuf/descriptor.py", line 621, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

@grafnu grafnu merged commit 95d61b5 into master Oct 5, 2024
18 of 34 checks passed
@ohshazbot ohshazbot deleted the Mirror-dependencies branch October 8, 2024 17:44
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

Successfully merging this pull request may close these issues.

2 participants