Boto does not recognize ~.aws/credentials
See original GitHub issueFollowing the Quickstart in the docs and am unable to authenticate using my ~/.aws/credentials files (aws cli commands work OK):
>>> import boto3
>>>
>>> for bucket in boto3.resource('s3').buckets.all():
... print(bucket.name)
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/boto3/resources/collection.py", line 83, in __iter__
for page in self.pages():
File "/Library/Python/2.7/site-packages/boto3/resources/collection.py", line 161, in pages
pages = [getattr(client, self._py_operation_name)(**params)]
File "/Library/Python/2.7/site-packages/botocore/client.py", line 310, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/Library/Python/2.7/site-packages/botocore/client.py", line 396, in _make_api_call
operation_model, request_dict)
File "/Library/Python/2.7/site-packages/botocore/endpoint.py", line 111, in make_request
return self._send_request(request_dict, operation_model)
File "/Library/Python/2.7/site-packages/botocore/endpoint.py", line 136, in _send_request
request = self.create_request(request_dict, operation_model)
File "/Library/Python/2.7/site-packages/botocore/endpoint.py", line 120, in create_request
operation_name=operation_model.name)
File "/Library/Python/2.7/site-packages/botocore/hooks.py", line 226, in emit
return self._emit(event_name, kwargs)
File "/Library/Python/2.7/site-packages/botocore/hooks.py", line 209, in _emit
response = handler(**kwargs)
File "/Library/Python/2.7/site-packages/botocore/signers.py", line 84, in handler
return self.sign(operation_name, request)
File "/Library/Python/2.7/site-packages/botocore/signers.py", line 119, in sign
signer.add_auth(request=request)
File "/Library/Python/2.7/site-packages/botocore/auth.py", line 621, in add_auth
raise NoCredentialsError
botocore.exceptions.NoCredentialsError: Unable to locate credentials
Issue Analytics
- State:
- Created 8 years ago
- Comments:13 (2 by maintainers)
Top Results From Across the Web
Credentials — Boto3 Docs 1.26.33 documentation - AWS
Configuring credentials¶. There are two types of configuration data in Boto3: credentials and non-credentials. Credentials include items such as ...
Read more >Cannot read a key from S3 with boto, but can with aws cli
Succeeds with the cli, but not with boto. I've looked at the boto source to see if it's doing anything that requires extra...
Read more >Introduction to Boto3 And AWS Credentials Setup ... - CloudThat
Boto is a software development kit of the Python SDK for AWS. ... To check if credentials are configured or not, go to...
Read more >AWS Boto3 and AWS Credentials Configuration Settings for ...
I will show you in this lesson how to install boto3 python in the computer and get started with boto3 aws python tutorial....
Read more >Resolving the Boto3 NoCredentialsError in Python - Rollbar
aws/credentials. Begin by navigating to this location and confirming the file exists. When opening the file in a text editor, you should see...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have a similar issue too. The default “profile” for boto to use is an IAM profile.
Now I need to add an additional (non-default) profile. However boto3/botocore only pickup the
~.aws/credentials
if both adefault
andother_profile
are defined.How do I not specify a
default
profile, and have an IAM profile be default, while also specifying otherother_profile...
in thecredentials
file?weird in my case,
Had
had to remove region part and it works