## TL;DR

For "Azure CLI 2.77.0 is broken: ImportError: DLL load failed while importing win32file: The specified module could not be fo": issue Azure/azure-cli#32045 (closed, 78 comments): ### Describe the bug I have just installed Azure CLI version 2.77.0 and if I then run 'az upgrade' or 'az version' I get the error shown below. ### Related command 'az upgrade' or 'az version' ### Errors Traceback (most recent call last): File "[frozen runpy]", line 198, in _run_module_as_main File "[frozen runpy]", line 88, in _run_code File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/

```text
Azure CLI 2.77.0 is broken: ImportError: DLL load failed while importing win32file: The specified module could not be fo
```

## When to use

Use this skill when you run into "Azure CLI 2.77.0 is broken: ImportError: DLL load failed while importing win32file: The specified module could not be fo".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

Versions mentioned in the source: 2.77.0, CLI 2.82.0. If you are on something much newer or older, the details may have shifted.

## Steps

1. Issue Azure/azure-cli#32045 (closed, 78 comments): ### Describe the bug I have just installed Azure CLI version 2.77.0 and if I then run 'az upgrade' or 'az version' I get the error shown below. ### Related command 'az upgrade' or 'az version' ### Errors Traceback (most recent call last): File "[frozen runpy]", line 198, in _run_module_as_main File "[frozen runpy]", line 88, in _run_code File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/__main__.py", line 13, in [module] File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/telemetry.py", line 19, in [module] File "D:\a\_wo

2. az crashing with 'ImportError: DLL load failed while importing win32file' after upgrading to 2.77.0+: fixed in Azure CLI 2.82.0 (the pywin32 dependency was downgraded from 311 to 310). Upgrade to 2.82.0+. Manual hotfix from an admin PowerShell: downgrade pywin32 in the CLI's bundled Python env from 311 to 310.
