Azure / azure-cli

Azure Command-Line Interface
MIT License
4.02k stars 2.99k forks source link

az interactive fails with ImportError: cannot import name 'Mapping' from 'collections' #22067

Open MasterWayZ opened 2 years ago

MasterWayZ commented 2 years ago

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az interactive

Errors:

The command failed with an unexpected error. Here is the traceback:
cannot import name 'Mapping' from 'collections' (C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python310.zip\collections\__init__.pyc)
Traceback (most recent call last):
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 658, in execute
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 692, in _run_job
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/interactive/custom.py", line 41, in start_shell
  File "C:\Users\Michelle Godfrey\.azure\cliextensions\interactive\azext_interactive\__init__.py", line 10, in start_shell
    from .azclishell.app import AzInteractiveShell
  File "C:\Users\Michelle Godfrey\.azure\cliextensions\interactive\azext_interactive\azclishell\app.py", line 21, in <module>
    from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
  File "C:\Users\Michelle Godfrey\.azure\cliextensions\interactive\prompt_toolkit\__init__.py", line 16, in <module>
    from .interface import CommandLineInterface
  File "C:\Users\Michelle Godfrey\.azure\cliextensions\interactive\prompt_toolkit\interface.py", line 19, in <module>
    from .application import Application, AbortAction
  File "C:\Users\Michelle Godfrey\.azure\cliextensions\interactive\prompt_toolkit\application.py", line 8, in <module>
    from .key_binding.bindings.basic import load_basic_bindings
  File "C:\Users\Michelle Godfrey\.azure\cliextensions\interactive\prompt_toolkit\key_binding\bindings\basic.py", line 9, in <module>
    from prompt_toolkit.renderer import HeightIsUnknownError
  File "C:\Users\Michelle Godfrey\.azure\cliextensions\interactive\prompt_toolkit\renderer.py", line 11, in <module>
    from prompt_toolkit.styles import Style
  File "C:\Users\Michelle Godfrey\.azure\cliextensions\interactive\prompt_toolkit\styles\__init__.py", line 8, in <module>
    from .from_dict import *
  File "C:\Users\Michelle Godfrey\.azure\cliextensions\interactive\prompt_toolkit\styles\from_dict.py", line 9, in <module>
    from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python310.zip\collections\__init__.pyc)

To Reproduce:

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

Expected Behavior

It should work.

Environment Summary

Windows-10-10.0.22000-SP0
Python 3.10.3
Installer: MSI

azure-cli 2.35.0

Extensions:
interactive 0.4.1

Dependencies:
msal 1.17.0
azure-mgmt-resource 20.0.0

Additional Context

yonzhan commented 2 years ago

interactive