I am having below lambda function which uses Chalice.
from chalice import Chalice
from chalicelib import lookup_helper
import os
try:
from urllib import unquote
except ImportError:
from urllib.parse import unquote
app = Chalice(app_name='some_app')
@app.route('/some_route', methods=['GET'])
def some_func(arg):
//some code
When I test this function I get below error
{"errorMessage": "Unable to import module 'app': No module named 'app'", "errorType": "Runtime.ImportModuleError"}
Tue Sep 22 11:59:10 UTC 2020 : Lambda execution failed with status 200 due to customer function error: Unable to import module 'app': No module named 'app'.
Can anyone please help me out here. Python - 3.7
Update--
from chalice import Chalice
import os
app = Chalice(app_name='some_app')
@app.route('/some_route', methods=['GET'])
def some_func(arg):
return {}
Reduced the function to above. Still same error.
When I checked the pipeline (azure devops), I see below error in the logs, though the step passes as a whole.
FileExistsError: [Errno 17] File exists: 'build/lambda/requests'
requirement.txt
requests==2.22.0
see https://chalice-workshop.readthedocs.io/en/latest/media-query/00-intro-chalice.html
What is the name of you python file. Is it 'app.py' ?