使用带有Python和PyCharm的Kubeflow Pipelines SDK连接到AI平台管道

2024-04-25 22:51:01 发布

您现在位置:Python中文网/ 问答频道 /正文

在PyCharm IDE中使用windows 10和Python 3.9

我试图使用以下代码列出管道:

import kfp
client = kfp.Client(host='.......bb92ea05-dot-us-central2.pipelines.googleusercontent.com')
    
client.list_pipelines()

我知道主机变量是正确的,因为我是从AI平台管道复制的。我遇到以下问题

FileNotFoundError: [WinError 2] The system cannot find the file specified

我认为无法找到该文件,因为该程序无法连接到GCP的AI平台管道。

我通过在Pycharm终端中执行以下命令安装了Kubeflow管道SDK:

  • conda create--name mlpipeline python=3.7
  • 康达管道
  • pip3安装kfp——升级——用户

当我跑步时:

kfp diagnose_me

我收到以下命令错误:

Google Cloud SDK is not installed, gcloud, gsutil and kubectl are required for this app to run. Please follow instructions at https://cloud.google.com/sdk/install to install the SDK

我已经试过了

  • 安装Google Cloud SDK并初始化gcloud(尽管我运行命令时会显示“未找到Python”
  • 使用gcloud命令安装kubectl和gsutil

Tags: the命令comclientcloud管道googlesdk
2条回答

我转换到Ubuntu,然后问题就解决了

我所做的:

  • 已安装Google Cloud SDK并对其进行了配置:https://cloud.google.com/sdk/docs/quickstart

    还可以使用gcloud components install component_id命令安装gsutil和kubectl

  • 安装KFP SDK:在终端中运行以下命令:

     apt-get update; apt-get install -y wget bzip2
     wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
     bash Miniconda3-latest-Linux-x86_64.sh
    
     conda create  name mlpipeline python=3.7   
     conda activate mlpipeline
    
     pip3 install kfp  upgrade
    

我遇到了完全相同的问题。我用Ubuntu操作系统而不是Windows操作系统修复了它。使用虚拟机并在虚拟机中运行Ubuntu。Ubuntu环境更易于设置和管理

相关问题 更多 >