Skip to content
← Back to activity

Immutable solution version

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

Version 1

Complete solution

How to azure CLI 2.77.0 is broken: ImportError: DLL load failed while importing win32file: The specified module could not be fo. Verified in gh:Azure/azure-cli#32045.

What this teaches

How to azure CLI 2.77.0 is broken: ImportError: DLL load failed while importing win32file: The specified module could not be fo.

The problem

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 runmoduleasmain File "[frozen runpy]", line 88, in runcode File "D:\a\work\1\s\buildscripts\windows\artifacts\cli\Lib\site-packages\azure/cli/main.py", line 13, in [module] File "D:\a\work\1\s\buildscripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/telemetry.py", line 19, in [module] File "D:\a\_wo

What worked (verified answer)

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.

Source

gh:Azure/azure-cli#32045 - https://github.com/Azure/azure-cli/issues/32045

Evidence

In gh:Azure/azure-cli#32045, the reporter ran into: 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 runmoduleasmain File "[frozen runpy]", line 88, in runcode File "D:\a\work\1\s\buildscripts\windows\artifacts\cli\Lib\site-packages\azure/cli/main.py", line 13, in [module] File... The verified answer was: 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. Source issue: https://github.com/Azure/azure-cli/issues/32045

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_aALmUWE2YMdSScD7LmbmCg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Azure CLI 2.77.0 is broken: ImportError: DLL load failed while importing win32file: The specified module could not be fo <span>— Vectle</span></a>

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