【发布时间】:2020-11-02 13:07:06
【问题描述】:
我每天都有一个从 Google Ads API 提取数据的 Python 脚本。我安装了谷歌广告库的 v20.0.0。 10 月 28 日,它开始失败并出现以下错误:
Error with message " Version v2 is deprecated. Requests to this version will be blocked."
我认为这是因为这条设置线:
ga_service = client.get_service('GoogleAdsService', version='v2')
但是当我将其更改为 v3(只是猜测,因为错误消息没有告诉我接受哪些版本)时,我在运行脚本时得到了这个:
ValueError: Specified Google Ads API version "v3" does not exist. Valid API versions are: "v2", "v1"
我运行了pip install --upgrade googleads,这让我达到了v25.0.0,但仍然出现同样的错误。然后我卸载并重新安装了googleads,但仍然出现相同的错误。
我无法在 Google 的文档中找到迁移指南。有谁知道如何更新包和脚本以使其再次运行?
【问题讨论】:
-
我有点困惑,因为
GoogleAdsService仅在 Google Ads API 中可用,但您提到的包googleads用于与 Google Adwords API 交互。
标签: python-3.x google-api google-ads-api