我正在尝试使用 vscode 从本地 Windows 计算机与 Watson Machine Learning 进行通信,以在虚拟环境中运行 jupyter 笔记本,但我无法让它工作。
我安装了
!pip install tensorflow
!pip install ibm_watson_machine_learning
我在同一个笔记本中创建并训练了一个 keras 模型 --> 张量流肯定已安装并运行。但当我跑步时:
from ibm_watson_machine_learning import APIClient
LOCATION = 'https://us-south.ml.cloud.ibm.com'
API_KEY = 'xxx-this-is-my-api-key-xxx'
wml_credentials = {
"apikey": API_KEY,
"url": LOCATION
}
wml_client = APIClient(wml_credentials)
我收到错误:
ImportError: The system lacks installations of pyspark, scikit-learn, pandas, xgboost, mlpipelinepy, ibmsparkpipeline and tensorflow. At least one of the libraries is required for the repository-client to be used`
有人知道该怎么办吗?
解决方案非常简单。 Watson Machine Learning 不支持虚拟环境。由于某种原因,它会检查您正在寻找的安装的全局环境,而不是用于运行它的虚拟环境:-/ --> 使用全局环境,然后一切正常
在python 3.10环境中安装以下包 pyspark scikit学习 熊猫 xgboost 张量流 ibm-watson-机器学习