I’m new in AWS also a beginner in python.
I have situation in here,I’m facing this kind of issue:
"The NoCredentialsError is an error encountered when using the Boto3 library to interface with Amazon Web Services (AWS).Specifically, this error is encountered when your AWS credentials are missing, invalid, or cannot be located by your Python script. "
File "/usr/lib/python2.7/site-packages/botocore/auth.py", line 373, in add_auth
raise NoCredentialsError()
NoCredentialsError: Unable to locate credentials
And i did some troubleshooting by checking the path given and the credentials is in there.
**[root@xxxxxx aws]# ls
config credentials
Which part am i missing and where else need to check?
Please advice.
2
Answers
I notice the error happen because of python are unable to communicate with aws api. What i do to settle this issue is:
1)Python version conflict - got 2 version at server which is 3.7 & 2.7 -AWS API so far not support python 3 -Solution: Remove python "yum remove python3" . 2)Re-install cloudwatch agent services at server "sudo yum install -y awslogs" . 3)Reconfigure cloudwatch config files steps https://youtu.be/22lzkpra_WU
Issue solved...thanks everyone...
The correct path is
~/.aws
, not~/aws
. Please double check your setup with aws docs: