我正在尝试通过Boto3读取S3存储桶,但出现此错误:
提高ConnectionError(err,request = request) botocore.vendored.requests.exceptions.ConnectionError :(“连接已中止。”,ConnectionResetError(10054,“远程主机强行关闭了现有连接”,无,10054,无))
import boto3
s3 =boto3.client('s3',aws_access_key_id='KEY',aws_secret_access_key='SECRET_KEY')
# Call S3 to list current buckets
response = s3.list_buckets()
# Get a list of all bucket names from the response
buckets = [bucket['Name'] for bucket in response['Buckets']]
# Print out the bucket list
print("Bucket List: %s" % buckets)