This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.58k
stars
2.8k
forks
source link
ImportError: cannot import name 'AccessTokenInfo' from 'azure.core.credentials' #37961
Describe the bug
When running the "az nexusidentity gen-keys" cli, I am running into the below error.
az nexusidentity gen-keysThe command failed with an unexpected error. Here is the traceback: cannot import name 'AccessTokenInfo' from 'azure.core.credentials' (C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\core\credentials.pyc)
To Reproduce
Steps to reproduce the behavior:
az extension add --name nexusidentity
az nexusidentity gen-keys
Expected behavior
Cli should work with prompting any errors.
Possible Cause
Nexusidentity extension installs latest version of azure_identity which relies on AccessTokenInfo from azure.core.credentials. However azure-cli doesn't have the packages installed and expecting the package to be present.
Observation
Though the packages are installed in this path '~.azure\cliextensions\nexusidentity, expectation is the packages to be present in this below path 'C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages
Manually copying the azureazure_identityazure_core to this C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages resolving the issue
Describe the bug When running the "az nexusidentity gen-keys" cli, I am running into the below error.
az nexusidentity gen-keys
The command failed with an unexpected error. Here is the traceback: cannot import name 'AccessTokenInfo' from 'azure.core.credentials' (C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\core\credentials.pyc)
To Reproduce Steps to reproduce the behavior:
Expected behavior Cli should work with prompting any errors.
Possible Cause Nexusidentity extension installs latest version of azure_identity which relies on AccessTokenInfo from azure.core.credentials. However azure-cli doesn't have the packages installed and expecting the package to be present.
Observation Though the packages are installed in this path '~.azure\cliextensions\nexusidentity
, expectation is the packages to be present in this below path 'C:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages
Manually copying theazure
azure_identity
azure_core
to thisC:\Program Files\Microsoft SDKs\Azure\CLI2\Lib\site-packages
resolving the issue