Azure-cli: No module named azure.cli - macOS homebrew

Created on 31 Jan 2019  路  7Comments  路  Source: Azure/azure-cli


Environment summary

Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (az --version) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows)

Tried both pip and brew methods.
Able to access azure-cli programmatically but the command version seems to be having some issue.
I am assuming python2.7 builtin mac is causing some issue but not able to make a reference for az to use.
OS version - mac os High Sierra
Shell Type - Bash

Went through other posts as well. It was quiet complex to understand and would really appreciate if anyone is able to help me on this.

I have also tried using instructions from azure documentation.

Both python2.7 and python3.6 has been installed in my mac. And tried reinstalling azure-cli in both brew and pip.

$ az
/usr/bin/python: No module named azure


Installation Packaging

All 7 comments

Howdy @nandhak21,

While I don't run into quite the same error, I'm essentially able to repro this. Except, on my machine (macOS 10.14.2) it is missing azure.mgmt.kusto. I'm investigating now.

I've confirmed with @tjprescott that this is the result of missing dependencies in the install_requirements portion of our setup.py. This bug will impact anyone install from pip, which includes brew users. However, it shows itself somewhat differently with pip direct users just not getting certain commands. I'm working on publishing a hot-fix now, which will be version 2.0.57.

For people blocked by this issue, you should still be able to install 2.0.55.
For brew users, there is a useful Stack Overflow post here: https://stackoverflow.com/questions/3987683/homebrew-install-specific-version-of-formula
Similarly pip users can use pip install -I azure-cli==2.0.55

Azure CLI 2.0.57 has been released and has fixed the problem. Thanks @marstr for the quick turnaround!

Thank you all for the quick fix..

Had a similar issue, fixed it with

python -m pip install azure-cli

I'm getting same error with azure-cli 2.0.80.
when I try python -m pip install azure-cli
I get below error:

ERROR: azure-cli-batchai 0.4.10 has requirement azure-mgmt-storage==3.3.0, but you'll have azure-mgmt-storage 7.1.0 which is incompatible.
ERROR: azure-cli-batchai 0.4.10 has requirement azure-storage-blob==1.3.1, but you'll have azure-storage-blob 1.5.0 which is incompatible.
ERROR: azure-cli-role 2.6.4 has requirement azure-mgmt-authorization==0.50.0, but you'll have azure-mgmt-authorization 0.52.0 which is incompatible.
ERROR: azure-cli-role 2.6.4 has requirement azure-mgmt-monitor==0.5.2, but you'll have azure-mgmt-monitor 0.7.0 which is incompatible.
ERROR: azure-cli-container 0.3.18 has requirement azure-mgmt-authorization==0.50.0, but you'll have azure-mgmt-authorization 0.52.0 which is incompatible.
ERROR: azure-cli-container 0.3.18 has requirement azure-mgmt-containerinstance==1.4.0, but you'll have azure-mgmt-containerinstance 1.5.0 which is incompatible.
ERROR: azure-cli-container 0.3.18 has requirement azure-mgmt-network==3.0.0, but you'll have azure-mgmt-network 7.0.0 which is incompatible.
ERROR: azure-cli-appservice 0.2.21 has requirement azure-mgmt-containerregistry==2.8.0, but you'll have azure-mgmt-containerregistry 3.0.0rc8 which is incompatible.
ERROR: azure-cli-appservice 0.2.21 has requirement azure-mgmt-storage==3.3.0, but you'll have azure-mgmt-storage 7.1.0 which is incompatible.

I think I'm getting this error since I tried to install azure-ml sdk from pip. Originally I had installed azure-cli from brew which was working.

Was this page helpful?
0 / 5 - 0 ratings