Boto3 not loading aws credentials file on windows

Viewed 1890

I am trying to use the credentials file to load my aws credentials on windows. I am using boto3, and it works properly when I set the credentials on windows system environment variables, but not when I created the credentials file in the %UserProfile%/.aws folder

The content of my credentials file is as follows ,(replaced my real tokens with XXXX):

[default]
aws_access_key_id=XXXXXXXXX
aws_secret_access_key=XXXXXXX
aws_session_token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Is there any way to trace the precedence boto3 uses to retrieve the credentials? Any thoughts on why it is not picking the values from the file?

2 Answers

Please follow this steps:

  1. pip install awscli
  2. aws configure -> put all your credentials
  3. Then try again and the error go away.

C:\Users\USERNAME.aws\credentials on Windows. This file can contain the credential details for the default profile and any named profiles.

Related