Install the Azure Machine Learning SDK for Python
This overview applies to the stable and experimental versions of this SDK. To change versions, use the dropdown in the upper left.
This article is a guide for different installation options for the SDK.
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:
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, run the following command.
pip install --upgrade azureml-sdk
Advanced install (extras)
The SDK contains several optional components (
extras) that will only be installed if specified. 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 optional components and their use-cases.
|Extra||Use-cases and installed packages|
||Allows usage of
||Installs non-native packages to ensure compatibility when working within an Azure Databricks environment. This extra cannot be combined with other components. See the additional use-case guidance for more information on using the SDK in an Azure Databricks environment.|
Install with extras
To install the SDK with
extras, append the component name(s) in brackets onto the default install. For example, the following command installs the SDK with the
pip install --upgrade azureml-sdk[explain,automl]
To access pre-release version (experimental version), specify the version during installation using pre-release semantics such as:
- X.YbN # Beta release – Preview channel
- X.YrcN # Release Candidate -- PyPi
To install the experimental version of the Azure Machine Learning SDK for Python, specify the
--pre flag to the
pip install such as:
$ pip install --pre azureml-sdk
If you want to run a custom install and manually manage the dependencies in your environment, you can individually install any package in the SDK.
If you get a message that PyYAML can't be uninstalled, use the following command instead:
pip install --upgrade azureml-sdk[explain,automl] --ignore-installed PyYAML
Starting with macOS Catalina, zsh (Z shell) is the default login shell and interactive shell. In zsh, use the following command which escapes brackets with "\" (backslash):
pip install --upgrade azureml-sdk\[explain,automl\]
Run the following code to verify your SDK version. This check may be necessary for verifying compatibility with certain tutorials and code samples.
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.
||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
Try these next steps to learn how to use the Azure Machine Learning service SDK for Python: