Skip to content

az login Fatal Python error: Failed to import encodings module #32074

@mjain36

Description

@mjain36

Describe the bug

I am getting following error when installed AzureCLI. I reinstalled AzureCLI and restarted computer as well but nothing worked. Same issue happening on any az command run.

Fatal Python error: Failed to import encodings module
Python runtime state: core initialized
Traceback (most recent call last):
File "encodings_init_.py", line 33, in
ImportError: cannot import name 'aliases' from partially initialized module 'encodings' (most likely due to a circular import) (C:\Program Files\Microsoft SDKs\Azure\CLI2\python313.zip\encodings_init_.pyc)

Related command

az -v
az login

Errors

Fatal Python error: Failed to import encodings module
Python runtime state: core initialized
Traceback (most recent call last):
File "encodings_init_.py", line 33, in
ImportError: cannot import name 'aliases' from partially initialized module 'encodings' (most likely due to a circular import) (C:\Program Files\Microsoft SDKs\Azure\CLI2\python313.zip\encodings_init_.pyc)

Issue script & Debug output

debug out put also show same error

Expected behavior

It should show azure version and allow login

Environment Summary

azure-cli python313

Additional context

No response

Metadata

Metadata

Assignees

Labels

Accountaz login/accountAuto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions