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

在GCP中为何出现AttributeError:模块无EndpointDeleteOp属性?

问题描述

代码示例:

from google.cloud import aiplatform
from google_cloud_pipeline_components import aiplatform as gcc_aip
... (流水线定义内代码:)
delete_endpoint_op = gcc_aip.EndpointDeleteOp(some_condition)

编译流水线时触发错误:

AttributeError: module 'google_cloud_pipeline_components.aiplatform' has no attribute 'EndpointDeleteOp'

已知对应版本文档中EndpointDeleteOp组件是存在的,怀疑是版本不匹配问题,如何检查并修复?

问题分析与解决

该错误是由于你安装的google-cloud-pipeline-components版本低于1.0.0导致的,EndpointDeleteOp是在1.0.0版本中新增的组件。

检查当前安装版本

在终端运行以下命令查看已安装的组件版本:

pip show google-cloud-pipeline-components

查看输出中的Version字段,若版本号小于1.0.0,即可确认版本不符。

修复步骤

执行升级命令将组件包升级到1.0.0或更高版本:

pip install --upgrade google-cloud-pipeline-components>=1.0.0

升级完成后重新编译流水线,即可正常使用EndpointDeleteOp组件。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.19 22:40:42