Hello,
Thank you for reaching out. This error can be observed as a result of the setup issues. Could you please try to re-download and install the latest version of our Python client libraries from here to remedy setup issues. Please give this a try and let me know if you still run into issues.
Regards,
Nikisha Patel, Google Ads API Team
Change like this bellow, then it works!
if trailing_metadata is not None:
for kv in trailing_metadata:
if kv[0] == self._failure_key:
try:
# error_protos = import_module(
# 'google.ads.google_ads.%s.proto.errors' %
# self._api_version)
if self._api_version == 1:
from google.ads.google_ads.v1.proto.errors import errors_pb2
else:
from google.ads.google_ads.v2.proto.errors import errors_pb2
ga_failure = errors_pb2.GoogleAdsFailure()
ga_failure.ParseFromString(kv[1])
return ga_failure
except DecodeError:
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/google/ads/google_ads/interceptors/exception_interceptor.py", line 68, in _get_google_ads_failurega_failure = error_protos.errors_pb2.GoogleAdsFailure()AttributeError: module 'google.ads.google_ads.v2.proto.errors' has no attribute 'errors_pb2'File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/google/ads/google_ads/interceptors/exception_interceptor.py", line 68, in _get_google_ads_failureChange like this bellow, then it works!
if trailing_metadata is not None:
for kv in trailing_metadata:
if kv[0] == self._failure_key:
try:
# ↓↓↓↓↓↓↓
errors_pb2 = import_module('google.ads.google_ads.%s.proto.errors.errors_pb2' %self._api_version)
# ↑↑↑↑↑↑↑
ga_failure = errors_pb2.GoogleAdsFailure()
ga_failure.ParseFromString(kv[1])
return ga_failure
except DecodeError:
return None
Hi,
Thank you for reaching out to us. I would suggest that you see this github post for a fix to the issue, or download and install the latest version of our client library to remedy setup issues. For Google Ads Python, you can find the latest version here. Let me know if you have further questions.
Thank you,
Bryan, Google Ads API Team