Azure-cli: az apim list fails with ModuleNotFoundError

Created on 4 Sep 2019  路  14Comments  路  Source: Azure/azure-cli

Describe the bug

az apim list fails with ModuleNotFoundError using version 2.0.72 of the CLI, which I installed yesterday.

Command Name
az apim list

Errors:

No module named 'azure.mgmt.apimanagement.models.api_management_client_enums'
Traceback (most recent call last):
pip-install-qxmmnr17\knack\knack\cli.py, ln 206, in invoke
cli\core\commands\__init__.py, ln 523, in execute
azure\cli\core\__init__.py, ln 291, in load_arguments
cli\core\commands\__init__.py, ln 290, in load_arguments
pip-install-qxmmnr17\knack\knack\commands.py, ln 97, in load_arguments
azure\cli\core\__init__.py, ln 488, in default_arguments_loader
azure\cli\core\__init__.py, ln 528, in get_op_handler
...
<frozen importlib._bootstrap>, ln 955, in _find_and_load_unlocked
<frozen importlib._bootstrap>, ln 665, in _load_unlocked
<frozen importlib._bootstrap_external>, ln 678, in exec_module
<frozen importlib._bootstrap>, ln 219, in _call_with_frames_removed
cli\command_modules\apim\custom.py, ln 9, in <module>
ModuleNotFoundError: No module named 'azure.mgmt.apimanagement.models.api_management_client_enums'

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

-No prerequisites_

  • az apim list

Expected Behavior

The CLI would list the API Mangement resources in my subscription.

Environment Summary

Windows-10-10.0.17134-SP0
Python 3.6.6
Shell: cmd.exe

azure-cli 2.0.72

Additional Context


API Management Service Attention customer-reported

Most helpful comment

I'm running into this same issue. Same versions as the last comment.

All 14 comments

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

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

Same issue.

Environment Summary

Windows7 Enterprise 6.1.7601 64-bit
Python 3.6.6
Shell: powershell.exe
azure-cli 2.0.72

Installer was run with a privilege limited user, then UAC prompt was authorized with a different user with admin rights.

Just ran into this now on windows server 2019. I'm running inside a VM on a private subnet (same vnet as APIM, different subnet). Also 2.0.072.

This is a blocker for me. Any updates?

Any update? I also ran into this issue on Windows 10.

Windows-10-10.0.18362
Python 3.6.6
Shell: cmd.exe

azure-cli 2.0.73

Same problem as #10496. I made a pull request that should fix this: #10623

I'm also having this issue. az apim list fails with:

```The command failed with an unexpected error. Here is the traceback:

No module named 'azure.mgmt.apimanagement.models.api_management_client_enums'
Traceback (most recent call last):
File "C:Users\VSSADM~1\AppData\LocalTemp\pip-install-mjd5h3hf\knack\knack\cli.py", line 206, in invoke
File "C:Users\VSSADM~1\AppData\LocalTemp\pip-install-mjd5h3hf\azure-cli-core\azure\cli\core\commands__init__.py", line 523, in execute
File "C:Users\VSSADM~1\AppData\LocalTemp\pip-install-mjd5h3hf\azure-cli-core\azure\cli\core__init__.py", line 294, in load_arguments
File "C:Users\VSSADM~1\AppData\LocalTemp\pip-install-mjd5h3hf\azure-cli\azure\cli\command_modules\apim__init__.py", line 28, in load_arguments
File "C:Users\VSSADM~1\AppData\LocalTemp\pip-install-mjd5h3hf\azure-cli\azure\cli\command_modules\apim_params.py", line 11, in
ModuleNotFoundError: No module named 'azure.mgmt.apimanagement.models.api_management_client_enums'

Version of CLI is:

azure-cli 2.0.77

command-modules-nspkg 2.0.3
core 2.0.77
nspkg 3.0.4
telemetry 1.0.4

Extensions:
aks-preview 0.4.17
azure-cli-iot-ext 0.8.6
azure-devops 0.16.0

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:Users\xxxx.azure\cliextensions'

Python (Windows) 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 02:47:15) [MSC v.1900 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.
```

I'm running into this same issue. Same versions as the last comment.

Just run into this issue as well. Using:
`
azure-cli 2.0.78

command-modules-nspkg 2.0.3
core 2.0.78
nspkg 3.0.4
telemetry 1.0.4
`

Same issue:
azure-cli 2.0.80

command-modules-nspkg 2.0.3
core 2.0.80
nspkg 3.0.4
telemetry 1.0.4

Same here:

azure-cli 2.0.81

command-modules-nspkg 2.0.3
core 2.0.81
nspkg 3.0.4
telemetry 1.0.4

same here with az apim delete:

No module named 'azure.mgmt.apimanagement.models.api_management_client_enums'
Traceback (most recent call last):
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-0u_uiwkq\knack\knack\cli.py", line 206, in invoke
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-0u_uiwkq\azure-cli-core\azure\cli\core\commands\__init__.py", line 528, in execute
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-0u_uiwkq\azure-cli-core\azure\cli\core\__init__.py", line 300, in load_arguments
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-0u_uiwkq\azure-cli\azure\cli\command_modules\apim\__init__.py", line 28, in load_arguments
  File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-0u_uiwkq\azure-cli\azure\cli\command_modules\apim\_params.py", line 11, in <module>
ModuleNotFoundError: No module named 'azure.mgmt.apimanagement.models.api_management_client_enums'
To open an issue, please run: 'az feedback'

version info: az --version

C:\WINDOWS\system32>az --version
azure-cli                          2.1.0

command-modules-nspkg              2.0.3
core                               2.1.0
nspkg                              3.0.4
telemetry                          1.0.4

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\Niek\.azure\cliextensions'
Python (Windows) 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 02:47:15) [MSC v.1900 32 bit (Intel)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.

Would really like an update on this. Same issue as everyone else.

Was this page helpful?
0 / 5 - 0 ratings