尝试使用boto3程序包访问s3对象。我收到以下错误。谁可以帮我这个事?
我正在python 3.7上运行
import boto3
s3 = boto3.resource('s3')
for bucket in s3.buckets.all():
print(bucket.name)
错误:
Traceback (most recent call last):
File "/Users/santosh/PycharmProjects/untitled/boto3.py", line 1, in module
import boto3
File "/Users/santosh/PycharmProjects/untitled/boto3.py", line 2, in module
s3 = boto3.resource('s3')
AttributeError: module 'boto3' has no attribute 'resource'