Trying to set up boto3 S3Transfer according to AWS docs:
import boto3
client = boto3.client('s3', 'us-east-1')
transfer = S3Transfer(client)
Result:
NameError: name 'S3Transfer' is not defined
Tried Python 2.7.11 and 3.5.1 (MacOS), same result. boto3 is installed and properly resolves in my IDE (IntelliJ):
Successfully installed boto3-1.2.3 botocore-1.3.26 docutils-0.12 futures-3.0.5 jmespath-0.9.0 python-dateutil-2.4.2
Any pointers would be appreciated.
Thanks, Ron
The S3Transfer
class is in the module boto3.s3.transfer
so you have to do something like this:
from boto3.s3.transfer import S3Transfer
import boto3
client = boto3.client('s3')
transfer = S3Transfer(client)
Note the import statement above. Also note that the S3Transfer methods are already integrated into the S3 client and S3 resource so you may not need to access it directly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With