PythonSection 类

定义要在运行的目标计算上使用的 Python 环境和解释器。

此类在类中使用 Environment

类 PythonSection 构造函数。

构造函数

PythonSection(**kwargs)

变量

名称 说明
user_managed_dependencies

指示 Azure 机器学习是否重复使用现有的 Python 环境。

如果设置为 True,则负责确保在选择在其中运行脚本的 Python 环境中提供所有必要的包。 如果为 False(默认值),Azure 将基于 conda 依赖项规范为你创建 Python 环境。 该环境生成一次,并在后续执行中重复使用,前提是 conda 依赖项保持不变。

interpreter_path
str

Python 解释器路径。 仅当 user_managed_dependencies=True 时,才使用此选项。 默认值为“python”。

conda_dependencies

Conda 依赖项。

属性

conda_dependencies_file

荒废的。 要用于此运行的 conda 依赖项文件的路径。

使用 <xref:azureml.core.environment.PythonSection.from_existing_conda_environment>。