>>> client = boto3.client('s3')
>>> client.list_objects_v2()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'S3' object has no attribute 'list_objects_v2'
>>>
>>> pp.pprint(client.list_objects_v2(Bucket='modesto-swatch-vzw-splitter', Prefix='Breitling-Unguidable', StartAfter='PRR'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'S3' object has no attribute 'list_objects_v2'
>>>>>> boto3.__version__
'1.3.1'
>>>
@AkhterAli
boto3 is built on top of botocore library. What is the version of botocore?
list_objects_v2 is added on 2016-05-06 with this commit https://github.com/boto/botocore/commit/fa0a846b27b795089d7bd665fd1b661892d8e761#diff-17ba5e28cee979d68fbd7632bf1aaea2 .
I think your botocore library is not up-to-date.
I can call list_objects_v2 with botocore 1.4.31 & boto3 1.3.1 combo:
>>> import botocore
>>> botocore.__version__
'1.4.31'
Yup, @quiver is right: your botocore seems to be out of date.
@quiver @JordonPhillips
While you're right it just doesn't to be out of date by much. I will give updating a try and see what I get.
Python 2.6.6 (r266:84292, May 22 2015, 08:34:51)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-15)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import boto3
>>> import botocore
>>> botocore.__version__
'1.4.3'
>>> client = boto3.client('s3')
>>> client.list_objects_v2()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'S3' object has no attribute 'list_objects_v2'
>>>
And that was it, minor updates did the trick.
>>> import boto3
>>> import botocore
>>> botocore.__version__
'1.4.34'
>>> client = boto3.client('s3')
>>> client.list_objects_v2()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/site-packages/botocore/client.py", line 278, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/lib/python2.6/site-packages/botocore/client.py", line 548, in _make_api_call
api_params, operation_model, context=request_context)
File "/usr/lib/python2.6/site-packages/botocore/client.py", line 601, in _convert_to_request_dict
api_params, operation_model)
File "/usr/lib/python2.6/site-packages/botocore/validate.py", line 270, in serialize_to_request
raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Missing required parameter in input: "Bucket"
>>>
Thanks guys.
Most helpful comment
@AkhterAli
boto3is built on top ofbotocorelibrary. What is the version of botocore?list_objects_v2is added on 2016-05-06 with this commit https://github.com/boto/botocore/commit/fa0a846b27b795089d7bd665fd1b661892d8e761#diff-17ba5e28cee979d68fbd7632bf1aaea2 .I think your botocore library is not up-to-date.
I can call
list_objects_v2with botocore 1.4.31 & boto3 1.3.1 combo: