Machinelearningnotebooks: No module named 'azureml.widgets'

Created on 3 Feb 2019  路  6Comments  路  Source: Azure/MachineLearningNotebooks

Getting No module named 'azureml.widgets' when trying to import from azureml.widgets import RunDetails in sample notebook aml-pipelines-getting-started.ipynb

Python 3.7.2
MacOS 10.14.3
SDK: 1.0.10

Most helpful comment

pip3 show azureml-sdkName: azureml-sdk
Version: 1.0.10
Summary: Microsoft Azure Machine Learning Python SDK
Home-page: https://docs.microsoft.com/en-us/azure/machine-learning/service/
Author: Microsoft Corp
Author-email: None
License: https://aka.ms/azureml-sdk-license
Location: /usr/local/lib/python3.7/site-packages
Requires: azureml-pipeline, azureml-core, azureml-train
Required-by:

I figured it out. I had to install also the notebooks component.
pip install 'azureml-sdk[notebooks]'.

This should be reflected better in the github readme :)

All 6 comments

Could you check your SDK version using pip show azureml-sdk? With newer versions the widget package should get automatically installed.

pip3 show azureml-sdkName: azureml-sdk
Version: 1.0.10
Summary: Microsoft Azure Machine Learning Python SDK
Home-page: https://docs.microsoft.com/en-us/azure/machine-learning/service/
Author: Microsoft Corp
Author-email: None
License: https://aka.ms/azureml-sdk-license
Location: /usr/local/lib/python3.7/site-packages
Requires: azureml-pipeline, azureml-core, azureml-train
Required-by:

I figured it out. I had to install also the notebooks component.
pip install 'azureml-sdk[notebooks]'.

This should be reflected better in the github readme :)

closing this since installing solved the issue

Apparently it's not possible to install the package on databricks:

java.lang.RuntimeException: ManagedLibraryInstallFailed: org.apache.spark.SparkException: PyPI package azureml-sdk has been installed already. The previous installed package is PyPI:(azureml-sdk)-(empty)-(empty)-(automl_databricks). Please remove the duplicated PyPI package and restart the cluster. for library:PythonPyPiPkgId(azureml-sdk[notebooks],None,None,List()),isSharedLibrary=false

I know the documentation for databricks mentions that the only installed package should be
azureml-sdk[automl_databricks] (https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-configure-environment), so the error was expected. However, if I'm using a Databricks environment to build models using Auto ML, I should also be able to use azureml.widgets from that environment (for example to evaluate feature importance of Auto ML results, as shown on https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-configure-auto-train). So the "azureml-sdk[automl_databricks]" should probably be updated to include azureml.widgets.

Yes, I also found that I was unable to install Notebooks on Databricks. I tried this:

dbutils.library.installPyPI('azureml-sdk', version='1.0.41', extras='notebooks, databricks')

and get this error:
PythonDriverLocal.PythonException: Python interpreter is not defined for ReplId-*

I am suspecting the RunDetails widget cannot be used on Databricks, only Jupyter, but cannot find anything conclusive...

Bumped into the same issue while following this official Microsoft Azure tutorial: https://docs.microsoft.com/en-gb/learn/modules/train-local-model-with-azure-mls/4-create-ml-experiment

and more specifically when running the "View the logged results" part on a Jupyter notebook locally.

from azureml.widgets import RunDetails

FYI, I solved it by running the following command:

pip3 install azureml.widgets

Was this page helpful?
0 / 5 - 0 ratings