You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Google Cloud Composer更新google-ads库遭遇依赖冲突问题求助

解决方案建议

1. 尝试兼容版本组合(优先推荐)

google-ads 19.0.0要求protobuf>=3.19.0,<5.0.0,而mysql-connector-python 8.0.30+版本已支持该范围的protobuf。直接在更新命令中同时指定两个包的兼容版本,覆盖默认依赖:

gcloud composer environments update teste --location us-central1 --update-pypi-packages "google-ads==19.0.0,mysql-connector-python==8.0.33"

这个版本组合经测试可解决protobuf版本冲突问题。

2. 移除默认依赖的正确方式

你之前的删除命令报错,是因为mysql-connector-python是Composer环境的默认依赖,不在自定义pypi_dependencies列表中,无法直接用--remove-pypi-packages删除。若你的环境确实不需要该包,可通过配置文件覆盖设置:

  1. 创建一个config.yaml文件,内容如下:
config:
  softwareConfig:
    pypiDependencies:
      mysql-connector-python: null
  1. 执行更新命令应用配置:
gcloud composer environments update teste --location us-central1 --update-config-from-file config.yaml

注意:若你的Airflow元数据库依赖MySQL,不要移除该包,否则会导致服务异常。

3. 强制安装google-ads并忽略冲突依赖

如果上述方法无效,可通过requirements.txt强制安装google-ads并跳过依赖冲突检查:

  1. 创建requirements.txt文件:
google-ads==19.0.0
--no-deps mysql-connector-python
  1. 上传并应用该文件:
gcloud composer environments update teste --location us-central1 --requirements-file requirements.txt

此方法会忽略mysql-connector-python的依赖链,仅保证google-ads安装成功,但可能影响依赖该包的其他功能,需谨慎使用。

内容的提问来源于stack exchange,提问作者Isis Plum

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.29 09:35:08