set up my AWS credentials and configure boto3, but I’m facing an issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2025 10:04 PM
Hi everyone,
I’m working on a project where I need to upload files from my local machine to an AWS S3 bucket using the boto3 library in Python. I’ve followed the official documentation to set up my AWS credentials and configure boto3, but I’m facing an issue when trying to upload a file.
I am using :
import boto3
s3 = boto3.client('s3')
bucket_name = 'my-bucket'
file_path = 'path/to/my/file.txt'
s3.upload_file(file_path, bucket_name, 'file.txt')
I’m encountering the following error:
botocore.exceptions.NoCredentialsError: Unable to locate credentials.
I’ve already set up my AWS Access Key ID and Secret Access Key in the ~/.aws/credentials file, but I’m still getting the same error message.
Has anyone encountered this issue before, or does anyone have suggestions on how to resolve it?
Thanks in advance!
Nima
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Mate,
Thanks for the ask, are you trying to read via notebook ? If so you need to pass the credentials either cluster level or best approach via secret scopes then it will work.
Please ignore if not matching with your ask.
Saran
Saran

