aws-api-gateway

librosa.load gives error "module 'soundfile' has no attribute 'SoundFile'

回眸只為那壹抹淺笑 提交于 2020-11-29 21:06:50
问题 I have deployed librosa, matplotlib and all its required dependencies using AWS-Lambda-layers and it's working fine. When I send a .wav file from postman using the binary format the librosa.load() gives me the following error { "errorMessage": "module 'soundfile' has no attribute 'SoundFile'", "errorType": "AttributeError", "stackTrace": [ " File \"/var/task/lambda_function.py\", line 83, in lambda_handler\n clip, sample_rate = librosa.load(file_name)\n", " File \"/opt/python/librosa/core

librosa.load gives error "module 'soundfile' has no attribute 'SoundFile'

醉酒当歌 提交于 2020-11-29 21:06:26
问题 I have deployed librosa, matplotlib and all its required dependencies using AWS-Lambda-layers and it's working fine. When I send a .wav file from postman using the binary format the librosa.load() gives me the following error { "errorMessage": "module 'soundfile' has no attribute 'SoundFile'", "errorType": "AttributeError", "stackTrace": [ " File \"/var/task/lambda_function.py\", line 83, in lambda_handler\n clip, sample_rate = librosa.load(file_name)\n", " File \"/opt/python/librosa/core

Lambda error “TypeError: 'str' object does not support item assignment Traceback”

若如初见. 提交于 2020-11-29 09:57:04
问题 I am trying out import json import uuid import boto3 def lambda_handler(event, context): dynamo_client = boto3.resource('dynamodb') loadeo_carrier_company = dynamo_client.Table('loadeo_carrier_company') item = {} item = event['body'] print(item) item['company_id'] = str(uuid.uuid4()) print (type(item)) try: loadeo_carrier_company.put_item( Item=item ) return { "statusCode": 200, "headers" : { "Access-Control-Allow-Origin" : "*" }, "message": json.dumps("Record has been inserted"), "body":

Lambda error “TypeError: 'str' object does not support item assignment Traceback”

若如初见. 提交于 2020-11-29 09:56:44
问题 I am trying out import json import uuid import boto3 def lambda_handler(event, context): dynamo_client = boto3.resource('dynamodb') loadeo_carrier_company = dynamo_client.Table('loadeo_carrier_company') item = {} item = event['body'] print(item) item['company_id'] = str(uuid.uuid4()) print (type(item)) try: loadeo_carrier_company.put_item( Item=item ) return { "statusCode": 200, "headers" : { "Access-Control-Allow-Origin" : "*" }, "message": json.dumps("Record has been inserted"), "body":