Registry / azure / azureml-train

azureml-train

JSON →
library1.62.0pypypi✓ verified 85d ago

The Azure Machine Learning Python SDK training package provides functionality for configuring, submitting, and managing machine learning training runs on Azure. It includes support for hyperparameter tuning (HyperDrive), automated ML (AutoML), and distributed training. Current version is 1.62.0, last updated in early 2025. Release cadence is monthly, aligned with the Azure ML SDK releases.

pip install azureml-train
INSTALL
IMPORT
SIG · AZUREML-TRAIN
A
azureml-train
azurepythonv1.62.0
Install
17.4s avg
Import
2828ms
Disk
266MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.62.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 2.908s · 246.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 17.4s · import 2.748s · 248MB
266MB installed
● package 266MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HyperDriveConfig
from azureml.train.hyperdrive import HyperDriveConfig
from azureml.train.hyperdrive import HyperDriveRunConfig
HyperDriveRunConfig was removed in earlier SDK versions. Use HyperDriveConfig.
AutoMLConfig
from azureml.train.automl import AutoMLConfig
from azureml.train.automl import AutoMLConfig (not from azureml.train or from azureml.core)
Common mistake: importing from wrong submodule.
ScriptRunConfig
from azureml.core import ScriptRunConfig
from azureml.train import ScriptRunConfig
ScriptRunConfig moved to azureml.core in SDK v1.0.85+.

Basic example: connect to workspace, create compute target, submit a HyperDrive sweep.

from azureml.core import Workspace, Experiment, ScriptRunConfig from azureml.core.compute import ComputeTarget, AmlCompute from azureml.core.compute_target import ComputeTargetException from azureml.train.hyperdrive import HyperDriveConfig, PrimaryMetricGoal, choice # Connect to workspace ws = Workspace.from_config() # Create a compute cluster (if not exists) cluster_name = "cpu-cluster" try: compute_target = ComputeTarget(workspace=ws, name=cluster_name) except ComputeTargetException: compute_config = AmlCompute.provisioning_configuration(vm_size='STANDARD_D2_V2', max_nodes=4) compute_target = ComputeTarget.create(ws, cluster_name, compute_config) compute_target.wait_for_completion(show_output=True) # Configure a hyperparameter sweep exp = Experiment(ws, 'my-experiment') src = ScriptRunConfig(source_directory='.', script='train.py', compute_target=compute_target) hyperdrive_config = HyperDriveConfig(run_config=src, hyperparameter_sampling=choice({'--lr': [0.01, 0.001]}), primary_metric_name='accuracy', primary_metric_goal=PrimaryMetricGoal.MAXIMIZE, max_total_runs=4) submitted_run = exp.submit(hyperdrive_config) submitted_run.wait_for_completion(show_output=True)
Debug
Known issues
breakingAzure ML SDK v2 is now preferred; v1 (azureml-train) is in maintenance mode. New features only for v2.
fix
Migrate to azure-ai-ml (v2). See Microsoft migration guide.
affects: >=1.62.0
deprecatedAutoMLConfig from azureml-train is deprecated in favor of azure-ai-ml automl.
fix
Use azure-ai-ml to create automated ML jobs.
affects: >=1.50.0
gotchaScriptRunConfig import changed from azureml.train to azureml.core in SDK v1.0.85.
fix
Always import ScriptRunConfig from azureml.core.
affects: >=1.0.85
gotchaHyperDriveConfig replaces deprecated HyperDriveRunConfig. Using old name causes ImportError.
fix
Use from azureml.train.hyperdrive import HyperDriveConfig.
affects: >=1.0.85
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'azureml.train'
Missing azureml-train package or import path mismatch.
fix
Run: pip install azureml-train. Ensure import uses correct submodule, e.g., 'from azureml.train.hyperdrive import ...'.
ImportError: cannot import name 'ScriptRunConfig' from 'azureml.train'
ScriptRunConfig was moved to azureml.core in recent SDK versions.
fix
Change import to: from azureml.core import ScriptRunConfig
AttributeError: module 'azureml.train.hyperdrive' has no attribute 'HyperDriveRunConfig'
HyperDriveRunConfig was renamed to HyperDriveConfig.
fix
Use 'HyperDriveConfig' instead. Import: from azureml.train.hyperdrive import HyperDriveConfig
Upgrade
Version history
1.62.0latest on PyPI · released Feb 25, 2026
Audit
Dependencies
azureml-coreoptionalCore functionality for Workspace, Experiment, Run, etc.
azureml-sdkoptionalMeta-package that includes all Azure ML SDK components.
Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
1
Resources
azureml-train — pip install azureml-train · libregistry