【问题标题】:Connecting to AI Platform Pipelines using the Kubeflow Pipelines SDK with Python and PyCharm使用带有 Python 和 PyCharm 的 Kubeflow Pipelines SDK 连接到 AI Platform Pipelines
【发布时间】:2021-03-08 04:30:36
【问题描述】:

在 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 PLatform Pipeline。

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

  • conda create --name mlpipeline python=3.7
  • conda 激活 mlpipeline
  • pip3 install kfp --upgrade --user

我跑步时:

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

【问题讨论】:

    标签: python kubernetes kubeflow kubeflow-pipelines google-cloud-ai-platform-pipelines


    【解决方案1】:

    我转换到 Ubuntu 并从那里解决了问题。

    我做了什么:

    • 安装谷歌云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
      

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        猜你喜欢
        • 2021-11-11
        • 2021-03-27
        • 2021-09-21
        • 2022-10-06
        • 2020-07-29
        • 2021-06-10
        • 2020-07-01
        • 1970-01-01
        • 2021-11-28
        相关资源
        最近更新 更多