import boto3 s3 = boto3.resource('s3') bucket = s3.Bucket('my-bucket-name') bucket.object_versions.filter(Prefix='my/key/prefix').delete()