question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

az ml not a valid command in bash and powershell on azure cli in portal

See original GitHub issue

Tried executing: az ml account experimentation create -n jps00001 -g MyResourceGroup Error: az: error: argument _command_package: invalid choice: ml

Environment summary

az --version in BASH on azure portal:

jim@Azure:~$ az --version azure-cli (2.0.23)

acr (2.0.17) acs (2.0.22) advisor (0.1.0) appservice (0.1.22) backup (1.0.3) batch (3.1.7) batchai (0.1.3) billing (0.1.6) cdn (0.0.10) cloud (2.0.10) cognitiveservices (0.1.9) command-modules-nspkg (2.0.1) configure (2.0.12) consumption (0.2.0) container (0.1.15) core (2.0.23) cosmosdb (0.1.15) dla (0.0.15) dls (0.0.18) eventgrid (0.1.5) extension (0.0.6) feedback (2.0.6) find (0.2.7) interactive (0.3.11) iot (0.1.15) keyvault (2.0.15) lab (0.0.13) monitor (0.0.13) network (2.0.19) nspkg (3.0.1) profile (2.0.16) rdbms (0.0.9) redis (0.2.10) reservations (0.1.0) resource (2.0.19) role (2.0.15) servicefabric (0.0.7) sql (2.0.17) storage (2.0.21) vm (2.0.20)

Python location ‘/opt/az/bin/python3’ Extensions directory ‘/home/jim/.azure/cliextensions’

Python (Linux) 3.6.1 (default, Dec 15 2017, 17:51:12) [GCC 4.8.4]

Legal docs and information: aka.ms/AzureCliLegal

az --version PowerShell in Azure:

Azure:> az --version azure-cli (2.0.22)

acr (2.0.16) acs (2.0.21) advisor (0.1.0) appservice (0.1.21) backup (1.0.3) batch (3.1.7) batchai (0.1.3) billing (0.1.6) cdn (0.0.10) cloud (2.0.10) cognitiveservices (0.1.9) command-modules-nspkg (2.0.1) configure (2.0.12) consumption (0.2.0) container (0.1.14) core (2.0.22) cosmosdb (0.1.15) dla (0.0.15) dls (0.0.18) eventgrid (0.1.5) extension (0.0.6) feedback (2.0.6) find (0.2.7) interactive (0.3.11) iot (0.1.14) keyvault (2.0.14) lab (0.0.13) monitor (0.0.13) network (2.0.18) nspkg (3.0.1) profile (2.0.15) rdbms (0.0.9) redis (0.2.10) reservations (0.1.0) resource (2.0.19) role (2.0.15) servicefabric (0.0.6) sql (2.0.16) storage (2.0.20) vm (2.0.19)

Python location ‘C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe’ Extensions directory ‘C:\Users\ContainerAdministrator\CloudDrive.pscloudshell.azure\cliextensions’

Python (Windows) 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal

Shell Type Azure portal bash and PowerShell on Azure, both same result

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

5reactions
vjrantalcommented, Mar 3, 2018

I had this same problem and in my case the issue was that pip installed azure-cli-ml to a location that wasn’t looked at when executing the system default python.

You could either fix the python / pip installation so that both point to the same location or check which python pip uses and then explicitly load the module with that python binary. For example:

/usr/local/opt/python/bin/python2.7 -m azure.cli ml account -h

You can see how az loads the module with something like cat $(which az).

I also noticed that just doing pip install azure-cli-ml might result into version compatibility issues. Getting tested versions can be done with:

pip install -r https://aka.ms/az-ml-o16n-cli-requirements-file
2reactions
tjprescottcommented, Feb 8, 2018

ML is not a module in the CLI. The ML team offers a customized version of the CLI that includes these commands.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Cloud Shell troubleshooting | Microsoft Learn
Launch Cloud Shell or a local shell with either Azure PowerShell or Azure CLI installed. Run the following commands in Bash or PowerShell:...
Read more >
The term 'az' is not recognized as the name of a cmdlet ...
ERROR: The term 'az' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of...
Read more >
Azure CLI vs PowerShell: The Difference Explained - MSP360
PowerShell and Bash are scripting languages available in Azure Cloud Shell. Azure CLI is used to issue a set of commands to add,...
Read more >
Azure Devops Model package AZURE CLI command - Edureka
az ml model package --in image-stage-test -m model_test:1 --ic ... cp command not working in Bash Script in build pipeline of azure devops....
Read more >
Top Azure CLI Commands For Managing Azure Resources
The Azure CLI is a standalone set of commands, which means that you do not need PowerShell. The Azure CLI is available for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found