Install the Azure Machine Learning SDK for Python
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 in an environment without a previous version of the package installed, run the following command.
pip install azureml-sdk
For your production environment, use
azureml-core instead of
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.
||Accelerates deep neural networks on FPGAs with the Azure ML Hardware Accelerated Models Service.|
||Provides classes for building and running automated machine learning experiments. Also installs common data science packages including
||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.|
||Contains functionality to detect when model training data has drifted from its scoring data.|
||Includes classes for understanding detailed feature importance in automated model tuning.|
||Used for model interpretability, including feature and class importance for blackbox and whitebox models.|
||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.|
||Provides functionality for scoring scripts to request raw HTTP access.|
||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 a previous version, make sure you upgrade all the dependencies as well:
pip install --upgrade --upgrade-strategy eager azureml-sdk
Verify your SDK version:
pip show azureml-core
To see all packages in your environment:
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.
||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: