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

使用Azure DevOps流水线向Azure ML注册数据集遇版本错误

问题:Azure DevOps流水线运行Python脚本注册数据集失败

以下是用于注册Azure Datastore并创建Dataset的Python脚本:

datastore = Datastore.register_azure_blob_container(
            workspace=workspace,
            datastore_name=datastore_name,
            account_name=datastore_account_name, # 存储账户名称
            container_name=datastore_container_name, # Azure Blob容器名称
            account_key=datastore_account_key) # 存储账户密钥

dataset = Dataset.Tabular.from_delimited_files(path = [(datastore, 'udata.csv')])

registered_dataset_name = 'udata set'
registered_dataset_description = 'sample dataset'

dataset.register(workspace=workspace,name=registered_dataset_name,description=registered_dataset_description)

本地运行该脚本可成功完成Datastore和Dataset的注册,但在Azure DevOps流水线中执行时触发如下错误:

ERROR: UserErrorException:
Message: Failed to load dataset definition with azureml-dataprep==4.12.4. Please install the latest version with "pip install -U azureml-dataprep".


解决方案

  • 升级流水线中的azureml-dataprep依赖
    在流水线的依赖安装步骤中,直接执行升级命令:

    pip install -U azureml-dataprep
    

    为避免其他依赖版本不兼容,建议同步升级所有Azure ML相关核心包:

    pip install -U azureml-core azureml-dataset-runtime azureml-dataprep
    
  • 对齐本地与流水线的依赖版本
    如果升级最新版引发其他兼容性问题,可导出本地环境的依赖版本,同步到流水线中。本地执行pip freeze导出依赖,提取所有azureml开头的包版本写入requirements.txt,然后流水线中执行:

    pip install -r requirements.txt
    
  • 检查Python环境一致性
    确认流水线使用的Python版本与本地完全一致,不同Python版本可能导致依赖包兼容性异常。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.09 08:01:03