📜  aws lambda 无法导入模块“lambda_function”:没有名为“requests”的模块 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:56.697000             🧑  作者: Mango

代码示例1
#requests library doesn't come by default in lambda. It looks like you are trying to import it in your function / library somewhere
# You would need to zip the requests library in the root of your zip file.
$ pip install requests -t ./.
#  Once it is completed, zip the application and upload it to the function. If you have a requirements.txt, add requests to it.
                (OR)
mkdir lambda_layers
cd lambda_layers
mkdir python
cd python
pip install requests -t ./
cd ..
zip -r python_modules.zip .