s3 = boto3.resource('s3')
bucket_name = "python-sdk-sample-%s" % uuid.uuid4()
print("Creating new bucket with name:", bucket_name)
s3.create_bucket(Bucket=bucket_name)
我已经将我的凭据文件保存在
C:\Users\myname\.aws\credentials
,Boto应该从这里读取我的凭据。
我的设置有问题吗?
下面是boto3.set_stream_logger('botocore', level='DEBUG')
的输出。
2015-10-24 14:22:28,761 botocore.credentials [DEBUG] Skipping environment variable credential check because profile name was explicitly set.
2015-10-24 14:22:28,761 botocore.credentials [DEBUG] Looking for credentials via: env
2015-10-24 14:22:28,773 botocore.credentials [DEBUG] Looking for credentials via: shared-credentials-file
2015-10-24 14:22:28,774 botocore.credentials [DEBUG] Looking for credentials via: config-file
2015-10-24 14:22:28,774 botocore.credentials [DEBUG] Looking for credentials via: ec2-credentials-file
2015-10-24 14:22:28,774 botocore.credentials [DEBUG] Looking for credentials via: boto-config
2015-10-24 14:22:28,774 botocore.credentials [DEBUG] Looking for credentials via: iam-role
boto3.set_stream_logger('botocore', level='DEBUG')
并输出调试信息?这将显示它正在寻找凭据的位置。 - jameslsbotocore.exceptions.NoRegionError: You must specify a region.
*我的配置文件↓与我的凭据位于同一文件夹中。[default] ap-northeast-1
- d-_-b