I am writing a Python Lambda in Cloud9.
Trying to run it (locally, before deploying to the backend), I'm receiving this error:
Invalid lambda response received: Invalid API Gateway Response Keys: {'errorType', 'errorMessage'} in {'errorMessage': "Unable to import module 'getPersonByKey': No module named 'requests'", 'errorType': 'Runtime.ImportModuleError'}
I am NOT using requests in my code, not importing it, it is not included in the requirements.txt file.
This is my Lambda code:
import json
import pyTigerGraphBeta as tg
def lambda_handler(event, context):
try:
conn = tg.TigerGraphConnection(host="https://skillblaster-dev.i.tgcloud.io", graphname="SkillBlasterDev", useCert=True)
conn.apiToken = conn.getToken("rak++++++++++41f")[0]
print("Calling to run installed query")
result = conn.runInstalledQuery("getPersonByKey", {"keyPerson":"[email protected]"})
except Exception as e:
print(e)
raise e
return {
"statusCode": 200,
"body": json.dumps("TEST"),
}
What am I missing?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…