azure-sdk-for-python
azure-sdk-for-python copied to clipboard
ImportError: cannot import name 'TokenCredential' from 'azure.core.credentials
Hi, We were trying create a python app using ms-graph SDK for python and got the following error:
from .azure_identity_access_token_provider import AzureIdentityAccessTokenProvider
File "C:\Users\Gayathri Prasad\anaconda3\envs\msgraph2\lib\site-packages\kiota_authentication_azure\azure_identity_access_token_provider.py", line 5, in
@G3gayathri Are you referring to any sample for this ? Can you please share your code snippet where you are getting this error?
I was trying to follow the tutorial provided here https://learn.microsoft.com/en-us/graph/tutorials/python?tabs=aad
@G3gayathri I have followed the article and do not see any issues getting it run with Graph SDK package.
Can you please check if you have installed pip install azure-identity and pip install msgraph-sdk before executing the main.py file.
@G3gayathri Please let us know if you have any questions.
@G3gayathri We will now proceed to close this thread. If there are further questions regarding this matter, please reopen it and we will gladly continue the discussion.
@SaurabhSharma-MSFT I'm having the same issue when importing defaultcredentials from the azure-ai-ml python library in an endpoint on machine learning studio. Any idea on why this happens? Haven't found any mention of the problem other than this issue...
@SaurabhSharma-MSFT I'm having the same issue when importing MLClient from azure.ai.ml in an endpoint on machine learning studio. Any suggestions ?
@hshujuan Refer to this, fixed the issue for me(should also be in current release) https://github.com/Azure/azure-sdk-for-python/issues/28369