Closed xavier-rbz closed 3 years ago
May I know the python version you are using?
I'm using Python 3.8.6 on Linux
I was able to create a subscription by running python create_subscription.py
. Though my python is 2.7.16. It seems the api is still working.
xavier, have you done the following steps as described in https://developers.google.com/gcp-marketplace-saas#1?
If you have, I am going to test it in a fresh python3 env.
I am going to close this issue since no response for 18 days. Please feel free to reopen it if you still face the same problem.
Pinning google-cloud-pubsub
to 1.4.0
on Python 3.8 got me around the issue to run the one-off script.
Thank you flebel for sharing this.
Preliminary steps: I created a fresh python venv, then installed prerequisites using
pip install --upgrade google-api-python-client google-cloud google-cloud-pubsub
.In https://developers.google.com/gcp-marketplace-saas#3, the provided create_subscription.py doesn't work out of the box:
subscriber.create_subscription
now requires thename
andtopic
arguments to be passed as keywords: its signature iscreate_subscription(request: google.cloud.pubsub_v1.types.Subscription = None, *, name: str = None, topic: str = None, push_config: google.cloud.pubsub_v1.types.PushConfig = None, ack_deadline_seconds: int = None, retry: google.api_core.retry.Retry = <object object>, timeout: float = None, metadata: Sequence[Tuple[str, str]] = ())
according to https://googleapis.dev/python/pubsub/latest/subscriber/api/client.html#google.cloud.pubsub_v1.subscriber.client.Client.create_subscriptionCheers