Install the Azure Machine Learning SDK for Python

This article is a guide for different installation options for the SDK.

Default install

The default installation covers a large number of use-cases and will not install any unnecessary native dependencies in your environment. The following native package structure will be installed via the azureml-sdk package without any extra components:

Note

When submitting runs, the SDK by default installs the azureml-defaults package to the environment where the run is executed. azureml-defaults contains the azureml-core and applicationinsights packages required for tasks such as logging metrics, uploading artifacts, and accessing data stores from within the run.

To install the default packages in an environment without a previous version of the package installed, run the following command.

pip install azureml-sdk

Production

For your production environment, use azureml-core instead of azureml-sdk.

pip install azureml-core

Then install any other packages required for your particular job.

Other azureml packages

The SDK contains many other optional packages that you can install. These include dependencies that aren't required for all use-cases, so they are not included in the default installation in order to avoid bloating the environment. The following table outlines some of these optional packages and their use-cases.

Additional package  Use-case
azureml-accel-models Accelerates deep neural networks on FPGAs with the Azure ML Hardware Accelerated Models Service.
azureml-train-automl Provides classes for building and running automated machine learning experiments. Also installs common data science packages including pandas, numpy, and scikit-learn. Install azureml-train-automl.

See the additional use-case guidance for more information on working with automl.
azureml-contrib Installs azureml-contrib-* packages, which include experimental functionality or preview features.
azureml-databricks Installs non-native packages to ensure compatibility when working within an Azure Databricks environment. See the additional use-case guidance for more information on using the SDK in an Azure Databricks environment.
azureml-datadrift Contains functionality to detect when model training data has drifted from its scoring data.
azureml-explain-model Includes classes for understanding detailed feature importance in automated model tuning.
azureml-interpret Used for model interpretability, including feature and class importance for blackbox and whitebox models.
azureml-widgets Provides support for interactive widgets in a Jupyter notebook environment. This is unnecessary to install if you aren't running in a Jupyter notebook (ex. if you are building in PyCharm), or if you don't need widgets enabled.
azureml-contrib-services Provides functionality for scoring scripts to request raw HTTP access.
azureml-tensorboard Provides classes and methods for exporting experiment run history and launching TensorBoard for visualizing experiment performance and structure.

For a full list of available packages, see AzureML on pypi.

Upgrade install

Upgrade a previous version, make sure you upgrade all the dependencies as well:

pip install --upgrade --upgrade-strategy eager azureml-sdk

Check version

Verify your SDK version:

pip show azureml-core

To see all packages in your environment:

pip list

You can also show the SDK version in Python, but this version will not include the minor version.

import azureml.core
print(azureml.core.VERSION)

To learn more about how to configure your development environment for Azure Machine Learning service, see Configure your development environment.

Additional use-case guidance

If your use-case is described below, note the guidance and any recommended actions.

Use-case Guidance
Using automl  Install the SDK in a 64-bit Python environment. A 64-bit environment is required because of a dependency on the LightGBM framework.
Using Azure Databricks In the Azure Databricks environment, use the library sources detailed in this guide for installing the SDK. Also, see these tips for further information on working with Azure Machine Learning SDK for Python on Azure Databricks.
Using Azure Data Science Virtual Machine Azure Data Science Virtual Machines created after September 27, 2018 come with the Python SDK preinstalled.
Running Azure Machine Learning tutorials or notebooks If you are using an older version of the SDK than the one mentioned in the tutorial or notebook, you should upgrade your SDK. Some functionality in the tutorials and notebooks may require additional Python packages such as matplotlib, scikit-learn, or pandas. Instructions in each tutorial and notebook will show you which packages are required.

Next steps

Try these next steps to learn how to use the Azure Machine Learning service SDK for Python:

  1. Read the overview to learn about key classes and design patterns with code samples.
  2. Follow this tutorial to begin creating experiments and models.