📌  相关文章
📜  无法导入模块“app”:在 lambda 中没有名为“requests”的模块 - 无论代码示例

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

代码示例2
#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 .