Key to boto3.client.get_batch_prediction() OutputURI



我正在尝试从boto3.client.get_batch_prediction()下载输出文件。我认为关键是outputuri的文件名,所以我正在做客户端:

    response = batch.get_batch_prediction()
    if response['Status'] == 'COMPLETED':
        key = response['OutputUri'][response['OutputUri'].find('Output_'):response['OutputUri'].find('.csv')+4]
        s3 = boto3.resource('s3')
        s3.meta.client.download_file(settings.AWS_S3_BUCKET_OUTPUT, key, '/tmp/hello.txt')

但这返回

调用头对象操作时发生错误(404):不 找到

我认为这意味着文件不存在。这意味着我已经错了钥匙,所以我如何找到它?

我弄错了密钥。自我注意:仔细阅读文档。

最新更新