我正在尝试运行一个清除 AWS SQS 队列的函数,但我不断收到此错误:
DataNotFoundError(data_path = name)botocore.exceptions.DataNotFoundError:无法加载数据:sqs
我已经安装了python 3.7、boto3-1.21.22、botocore-1.24.22。我也跑了pip install --upgrade botocore,但仍然遇到同样的错误。
sqs_client = boto3.client('sqs', AWS_DEFAULT_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
def purge_queue(queue_url):
try:
response = sqs_client.purge_queue(QueueUrl=queue_url)
except ClientError as e:
logger.exception("Unexpected exception! %s", e)
raise
else:
return response
Run Code Online (Sandbox Code Playgroud)