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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 2.908s · 246.6MB
glibcpy 3.10–3.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)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'azureml.train'
Missing azureml-train package or import path mismatch.
fixRun: 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.
fixChange import to: from azureml.core import ScriptRunConfig
AttributeError: module 'azureml.train.hyperdrive' has no attribute 'HyperDriveRunConfig'
HyperDriveRunConfig was renamed to HyperDriveConfig.
fixUse '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.