AttributeError:模块“ boto3”没有属性“ resource”

时间:2019-05-09 17:19:01

标签: boto3 python-3.7

尝试使用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'

0 个答案:

没有答案