- Newest
- Most votes
- Most comments
Hello, I think that you have to import all the botocore library
from botocore.vendored import requests
I tested the lambda, while using the layer that is mentioned in the web page and without it, and I have different warnings, while testing today:
- With the layer of the web page (Link:https://aws.amazon.com/es/blogs/compute/upcoming-changes-to-the-python-sdk-in-aws-lambda/):
/opt/python/botocore/vendored/requests/api.py:67: DeprecationWarning: You are using the post() function from 'botocore.vendored.requests'. This is not a public API in botocore and will be removed in the future. Additionally, this version of requests is out of date. We recommend you install the requests package, 'import requests' directly, and use the requests.post() function instead.
- Without the layer:
/var/runtime/botocore/vendored/requests/api.py:64: DeprecationWarning: You are using the post() function from 'botocore.vendored.requests'. This dependency was removed from Botocore and will be removed from Lambda after 2020/03/31. https://aws.amazon.com/blogs/developer/removing-the-vendored-version-of-requests-from-botocore/. Install the requests package, 'import requests' directly, and use the requests.post() function instead.
What I think is that the warning is already in the version that the lambda layer has, for that is showing that warning in that way, and also notice that in the first warning the botocore library is extracted from the /opt/ folder, where according to this AWS page: https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html, is the folder where layers are extracted for runtime execution.
I hope this can help you with your problem
Regards
Johnny Valenzuela
Hi Johnny
My apologies for having taken so long to respond to you kindly providing feedback to my question from way back in March 22. I thought I would have received an email alert that someone had posted a reply, so I hadn't gone back to check.
So a belated thanks very much for the assistance.
In the end I discovered I needed to download a specific Python 3.6 requests library (arn:aws:lambda:eu-west-1:215029992386:layer:Python36-Requests:1) adding as a layer to my Lambda function. This resolved my problem.
Thanks again
Cliff
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 10 days ago
- AWS OFFICIALUpdated 3 years ago