azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

Error : Unable to load extension azure-cli-ml

Open datarocksAmy opened this issue 6 years ago • 15 comments

Describe the Bug

It was working a couple of days ago when I ran the CI for installing azure ml extension and create a resource group through Azure CLI in Azure DevOps. Now it errors out saying it can't find the command.

  • Command Name

    az extension add -n azure-cli-ml az ml workspace create -g $(azureml.resourceGroup) -w $(azureml.workspaceName) -l $(azureml.location) --exist-ok --yes
  • Errors

    Unable to load extension 'azure-cli-ml: No module named 'azureml._cli_common''. ... az: 'ml' is not in the 'az' command group. See 'az --help'.

To Reproduce


Expected Behavior

Previously Azure CLI on Azure DevOps Build will add the extension for azure-cli-ml and enables Azure CLI to create workspace through az ml workspace create.

Environment Summary

Windows-10-10.0.17134 Build 17134
Python 3.6.8
Installer: MSI

azure-cli 2.10.1
extensions:
  azure-cli-ml 1.9.0

Additional Context


datarocksAmy avatar Aug 19 '20 19:08 datarocksAmy

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azureml-github.

ghost avatar Aug 19 '20 23:08 ghost

ml

yonzhan avatar Aug 19 '20 23:08 yonzhan

We did have a new extension release this Monday. However, I am unable to reproduce it.

Can you run az extension show -n azure-cli-ml and make sure you are on the latest version of azure-cli-ml (1.12.0)? If you are still seeing that error, you can also try running pip install azure-cli-common and see if that gets you past the error.

j-so avatar Aug 20 '20 17:08 j-so

I tried the az extention show -n azure-cli-ml + pip install azureml-cli-common w/ the latest version = 1.12.0 and this is what I got:

Unable to load extension 'azure-cli-ml: No module named 'azureml._cli_common''. Use --debug for more information.
2020-08-20T19:31:46.3887959Z {
2020-08-20T19:31:46.3888623Z   "extensionType": "whl",
2020-08-20T19:31:46.3889143Z   "metadata": {
2020-08-20T19:31:46.3889546Z     "author": "Microsoft Corporation",
2020-08-20T19:31:46.3889985Z     "author_email": "[email protected]",
2020-08-20T19:31:46.3890525Z     "azext.minCliCoreVersion": "2.3.1",
2020-08-20T19:31:46.3890972Z     "classifiers": [
2020-08-20T19:31:46.3891451Z       "Development Status :: 3 - Alpha",
2020-08-20T19:31:46.3891852Z       "Intended Audience :: Developers",
2020-08-20T19:31:46.3892301Z       "Intended Audience :: System Administrators",
2020-08-20T19:31:46.3892949Z       "Programming Language :: Python :: 3.5",
2020-08-20T19:31:46.3894930Z       "Programming Language :: Python :: 3.6",
2020-08-20T19:31:46.3895741Z       "Programming Language :: Python :: 3.7",
2020-08-20T19:31:46.3896192Z       "Programming Language :: Python :: 3.8"
2020-08-20T19:31:46.3896718Z     ],
2020-08-20T19:31:46.3897156Z     "description": "Azure ML CLI extension for Azure CLI.\n\n\n\n",
2020-08-20T19:31:46.3897736Z     "filename": "C:\\Program Files\\Common Files\\AzureCliExtensionDirectory\\azure-cli-ml\\azure_cli_ml-1.12.0.dist-info",
2020-08-20T19:31:46.3898308Z     "home_page": "https://docs.microsoft.com/python/api/overview/azure/ml/?view=azure-ml-py",
2020-08-20T19:31:46.3898775Z     "license": "Proprietary https://aka.ms/azureml-preview-sdk-license",
2020-08-20T19:31:46.3899090Z     "metadata_version": "2.0",
2020-08-20T19:31:46.3899317Z     "name": "azure-cli-ml",
2020-08-20T19:31:46.3899759Z     "platforms": [
2020-08-20T19:31:46.3900283Z       "UNKNOWN"
2020-08-20T19:31:46.3900490Z     ],
2020-08-20T19:31:46.3900665Z     "requires_dist": [
2020-08-20T19:31:46.3900867Z       "adal (>=1.2.1)",
2020-08-20T19:31:46.3901108Z       "docker (>=3.7.2)",
2020-08-20T19:31:46.3901307Z       "msrest (>=0.6.6)",
2020-08-20T19:31:46.3901559Z       "pyyaml (>=5.1.0)",
2020-08-20T19:31:46.3901764Z       "requests (>=2.21.0)",
2020-08-20T19:31:46.3902031Z       "azureml-cli-common (~=1.12.0)"
2020-08-20T19:31:46.3902223Z     ],
2020-08-20T19:31:46.3902414Z     "requires_python": ">=3.5,<4",
2020-08-20T19:31:46.3902776Z     "summary": "Microsoft Azure Command-Line Tools AzureML Command Module",
2020-08-20T19:31:46.3903524Z     "version": "1.12.0"
2020-08-20T19:31:46.3904053Z   },
2020-08-20T19:31:46.3904221Z   "name": "azure-cli-ml",
2020-08-20T19:31:46.3904574Z   "path": "C:\\Program Files\\Common Files\\AzureCliExtensionDirectory\\azure-cli-ml",
2020-08-20T19:31:46.3904875Z   "version": "1.12.0"
2020-08-20T19:31:46.3905031Z }

datarocksAmy avatar Aug 20 '20 19:08 datarocksAmy

Just want to follow-up on this issue. Thanks

datarocksAmy avatar Aug 31 '20 13:08 datarocksAmy

@datarocksAmy apologies for the slow response, is this still an issue with more recent versions of the CLI?

lostmygithubaccount avatar Nov 05 '20 22:11 lostmygithubaccount

@datarocksAmy apologies for the slow response, is this still an issue with more recent versions of the CLI?

Yes

datarocksAmy avatar Nov 11 '20 17:11 datarocksAmy

closing due to no responses

swatig007 avatar Jan 04 '21 19:01 swatig007

@lostmygithubaccount @swatig007 Hello, I also hit this issue today.

Guessing this should still open given @datarocksAmy was waiting on a reply 😊


Will look to see if I can create a reproducible example. Basic details for now, running on Devops AzureClI@2 (v2.0.16), Python 3.6.10, Ubuntu Latest.

2021-01-05T13:34:12.7684475Z Command arguments: ['extension', 'add', '-n', 'azure-cli-ml', '--debug']
...
2021-01-05T13:35:30.4414339Z Saved the whl to /azp/agent/_work/_temp/.azclitask/cliextensions/azure-cli-ml/azure_cli_ml-1.19.0-py3-none-any.whl
2021-01-05T13:35:30.4414814Z Command index has been invalidated.
2021-01-05T13:35:30.4415383Z Event: CommandInvoker.OnTransformResult [<function _resource_group_transform at 0x7fc26b7811e0>, <function _x509_from_base64_to_hex_transform at 0x7fc26b781268>]
2021-01-05T13:35:30.4415944Z Event: CommandInvoker.OnFilterResult []
2021-01-05T13:35:30.4416376Z Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7fc26b959598>]
2021-01-05T13:35:30.4416790Z az_command_data_logger : exit code: 0
2021-01-05T13:35:30.4417260Z Command ran in 71.008 seconds (init: 0.077, invoke: 70.931)
2021-01-05T13:35:31.8875369Z Unable to load extension 'azure-cli-ml: No module named 'azureml._cli_common''. Use --debug for more information.
2021-01-05T13:35:31.9037292Z Extension 'azure-cli-ml' is already installed.
2021-01-05T13:35:33.2034718Z The command requires the extension azure-cli-ml.

will-franceys avatar Jan 05 '21 15:01 will-franceys

Thanks for the update. Re-opening the issue and assigning to @lostmygithubaccount . @lostmygithubaccount can you please take a look since this is still an issue

swatig007 avatar Jan 05 '21 17:01 swatig007

please also assign @j-so, i'm unable to

lostmygithubaccount avatar Jan 05 '21 17:01 lostmygithubaccount

For anyone else facing this:

  • We switched to using the azureml-core python package directly rather than the CLI.
  • Wasn't able to reproduce in a minimally reproducible way in a reasonable amount of time. For myself the loading of the extension was previously working and then stopped on a set of changes. The most obvious changes was actually the introduction of azureml-core (v1.1.9 at time of writing) in one of our dependencies - though this may be a red herring.

will-franceys avatar Jan 06 '21 16:01 will-franceys

I can't repro this on my own DevOps pipeline.

In the past, I've seen compatibility issues due to a mismatch of packages (az extension add won't warn for existing dependencies that are incompatible with the extension). This comes up often with DevOps pipelines because of custom docker images setting azureml packages to a certain version, and then a new version of the AzureML CLI is published. I haven't seen it manifest itself in extension load errors before, but this is the only idea I have right now.

j-so avatar Jan 06 '21 20:01 j-so

#please-close - no repro

lostmygithubaccount avatar Mar 02 '21 18:03 lostmygithubaccount