【发布时间】:2021-12-07 01:56:13
【问题描述】:
我正在尝试运行这样的代码 sn-p:
s3_file_path = "testunzipping/sample.csv.gz"
s3 = boto3.client('s3')
lst = s3.list_objects(Bucket='testunzipping')['Contents']
firstbucket = s3.Bucket('testunzipping')
但我在最后一行收到一个错误:
"errorMessage": "'S3' object has no attribute 'Bucket'",
后来我像这样使用第一个桶:
firstbucket.upload_fileobj(destination_file_gz, s3_filename)
我做错了什么?我也尝试使用bucket 而不是Bucket
【问题讨论】:
标签: python amazon-web-services amazon-s3 boto attributeerror