简体   繁体   中英

AWS textract - start expense analysis

While implementing aws textract Analyse Expense asynchronous api using boto3 for python, I'm getting error as

'Textract' object has no attribute 'start_expense_analysis'.

on the other hand, start_document_text_detection is working fine for me in the same environment.

Code:

def startAnalyseJob(s3BucketName, objectName):
    textract = boto3.client('textract')
    response = textract.start_expense_analysis(
    DocumentLocation={
        'S3Object': {
            'Bucket': s3BucketName,
            'Name': objectName
        }
    })
    return response["JobId"]

jobId = startAnalyseJob(bucket, key)

Error:

[ERROR] AttributeError: 'Textract' object has no attribute 'start_expense_analysis'

This errors occur when attempting to call an AWS service or AWS API that requires the latest version of the SDK. Try to upgrade your installation of Boto3 with the following commands:

pip install --upgrade botocore
pip install --upgrade boto3

Additional troubleshooting steps available here: https://aws.amazon.com/premiumsupport/knowledge-center/lambda-python-runtime-errors/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM