import boto3 BUCKET = 'your-bucket-here' s3 = boto3.resource('s3') bucket = s3.Bucket(BUCKET) bucket.object_versions.delete()