Command Name
az monitor log-analytics workspace create
Errors:
No module named 'azure.mgmt.monitor.models._models'
Traceback (most recent call last):
azure\mgmt\monitor\models\__init__.py, ln 14, in <module>
from ._models_py3 import Action
ModuleNotFoundError: No module named 'azure.mgmt.monitor.models._models_py3'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
Temp\pip-install-z6h9b3s8\knack\knack\cli.py, ln 215, in invoke
azure\cli\core\commands\__init__.py, ln 552, in execute
azure-cli-core\azure\cli\core\__init__.py, ln 374, in load_arguments
azure\cli\command_modules\monitor\__init__.py, ln 52, in load_arguments
azure\cli\command_modules\monitor\_params.py, ln 26, in load_arguments
azure\mgmt\monitor\models\__init__.py, ln 112, in <module>
from ._models import Action
ModuleNotFoundError: No module named 'azure.mgmt.monitor.models._models'
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
az monitor log-analytics workspace create -g {} -n {} --subscription {}Windows-10-10.0.17134-SP0
Python 3.6.6
Installer: MSI
azure-cli 2.4.0
Extensions:
aks-preview 0.4.6
connectedk8s 0.1.3
dev-spaces 1.0.0
When running the command with correct parameters, I get the below error:
The command failed with an unexpected error. Here is the traceback:
No module named 'azure.mgmt.monitor.models._models'
Traceback (most recent call last):
File "C:Program Files (x86)Microsoft SDKsAzureCLI2libsite-packagesazuremgmtmonitormodels__init__.py", line 14, in
from ._models_py3 import Action
ModuleNotFoundError: No module named 'azure.mgmt.monitor.models._models_py3'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:UsersVSSADM~1AppDataLocalTemppip-install-z6h9b3s8knackknackcli.py", line 215, in invoke
File "C:UsersVSSADM~1AppDataLocalTemppip-install-z6h9b3s8azure-cli-coreazureclicorecommands__init__.py", line 552, in execute
File "C:UsersVSSADM~1AppDataLocalTemppip-install-z6h9b3s8azure-cli-coreazureclicore__init__.py", line 374, in load_arguments
File "C:UsersVSSADM~1AppDataLocalTemppip-install-z6h9b3s8azure-cliazureclicommand_modulesmonitor__init__.py", line 52, in load_arguments
File "C:UsersVSSADM~1AppDataLocalTemppip-install-z6h9b3s8azure-cliazureclicommand_modulesmonitor_params.py", line 26, in load_arguments
File "C:Program Files (x86)Microsoft SDKsAzureCLI2libsite-packagesazuremgmtmonitormodels__init__.py", line 112, in
from ._models import Action
ModuleNotFoundError: No module named 'azure.mgmt.monitor.models._models'
add to S170
@kethahel99 Hi. Could you share your installation method? pip, msi, apt or something else?
@kethahel99 any update for this?
@kethahel99 reinstalling it should fix the issue.
If you don't meet this issue anymore, I would close this issue later.
Hello, apologies. I installed using chocolatey on Windows 10
@kethahel99 Hi. Could you reinstall it according to our doc? https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-windows?view=azure-cli-latest
@kethahel99 Hi~ Did you solve the issue? @fengzhou-msft Could you confirm whether we can install azure cli through chocolatey?
Hello @MyronFanQiu .
I tried the command again after reinsalling using chocolatey and it works

Thanks!
@kethahel99 Good to know! I closed this issue first.