Botocore No Longer Vendors The Requests Package
Recently, Botocore was updated to no longer include the popular Requests Python library. Previously, it was very simple to make a web request without having to include outside dependencies.
If you were editing inline functions in Lambda, and you need to use the request package, you’re out of luck. Fortunately, there’s still a simple way to upload lambda functions and run code quickly.
Install the request package and bundle in your local directory.
pip install requests -t ./
Import the requests library in your code:
Change file permissions:
chmod -R 775 .
Zip up your directory:
zip -r ../deploymentPackage.zip .
Upload the resulting zip file directly in lambda:
This is a simple, effective way to include a python package in your lambda function.