当我试着跑az bicep version米的时候,我得到了这个 error

The command failed with an unexpected error. Here is the traceback:
[WinError 193] %1 is not a valid Win32 application
Traceback (most recent call last):
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 664, in execute
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 729, in _run_jobs_serially
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 698, in _run_job
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 334, in __call__
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/custom.py", line 4601, in show_bicep_cli_version
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/_bicep.py", line 94, in run_bicep_command
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/_bicep.py", line 267, in _get_bicep_installed_version
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/_bicep.py", line 305, in _run_command
  File "subprocess.py", line 548, in run
  File "subprocess.py", line 1026, in __init__
  File "subprocess.py", line 1538, in _execute_child
OSError: [WinError 193] %1 is not a valid Win32 application

我运行所有az bicep ***个命令时都出现了同样的错误.

我try 重新安装蔚蓝CLI.也没帮上忙. 我从路径环境变量中删除了py相关路径.这是来自一些GitHub问题页面的建议.

推荐答案

最有可能的错误原因是Azure CLI安装的二头肌可执行文件已损坏.在他们的存储库上查看Issue #2364.

comment中所述,您可以清理%USERPROFILE\.azure\bin目录并运行az bicep install以使其工作.

Python相关问答推荐

pandas DataFrame GroupBy.diff函数的意外输出

如何将ctyles.POINTER(ctyles.c_float)转换为int?

如果值不存在,列表理解返回列表

Python库:可选地支持numpy类型,而不依赖于numpy

为什么默认情况下所有Python类都是可调用的?

无法使用requests或Selenium抓取一个href链接

如何在给定的条件下使numpy数组的计算速度最快?

NumPy中条件嵌套for循环的向量化

根据列值添加时区

基于形状而非距离的两个numpy数组相似性

从列表中获取n个元素,其中list [i][0]== value''

语法错误:文档. evaluate:表达式不是合法表达式

mdates定位器在图表中显示不存在的时间间隔

每次查询的流通股数量

极柱内丢失类型信息""

python3中np. divide(x,y)和x/y有什么区别?'

使用Scikit的ValueError-了解

利用广播使减法更有效率

对列中的数字进行迭代,得到n次重复开始的第一个行号

Pandas:新列,从列表中采样,基于列值