尝试在 kubernettes 上部署机器学习模型,因 ModuleNotFoundError 失败:没有名为“Cython”或“setuptools_rust”的模块

时间:2021-07-19 23:27:10

标签: azure-machine-learning-studio azure-machine-learning-service

这是我的环境 yml 文件:-

# Conda environment specification. The dependencies defined in this file will
# be automatically provisioned for runs with userManagedDependencies=False.
# Details about the Conda environment file format:
# https://conda.io/docs/user-guide/tasks/manage-environments.html#create-env-file-manually


name: project_environment
dependencies:
  # The python interpreter version.

  # Currently Azure ML only supports 3.5.2 and later.

- python
- pip

- pip:
    # Required packages for AzureML execution, history, and data preparation.

  - azureml-defaults
  - scikit-learn

  - numpy
  - azureml-monitoring
  - cython
  - setuptools_rust

它在下面的代码中失败了:

-
deployment_config = AksWebservice.deploy_configuration(auth_enabled=False, collect_model_data=True, enable_app_insights=True, cpu_cores = 2, memory_gb = 2)
aks_target = AksCompute(ws,aks_name)
(On below line getting error)
service = Model.deploy(ws, service_name, [model], inference_config, deployment_config, aks_target)
service.wait_for_deployment(show_output = True)

1 个答案:

答案 0 :(得分:0)

未安装 setuptools 或未安装在同一路径时会发生类似问题。您的 setup.py 文件需要 setuptools。卸载和安装可能会有所帮助,它解决了我的问题。

pip uninstall setuptools

然后:

pip install setuptools

此外,有时 pip 版本也会导致此问题。

pip3 install -U pip
相关问题