I am using Lambda Python 3.9 runtimes. I also use boto3 and botocore default packages in Lambda.
Today, I suddenly got this error: "cannot import name "'DEPRECATED_SERVICE_NAMES'" from 'botocore.docs'". I only succeeded in fixing it when I added the botocore package to the lambda runtime. I want to avoid it since it increases the size of the layer by 10 MB.
Any help? thanks
There is an issue with the latest releases of boto3. You can see the issue here: https://github.com/boto/boto3/issues/3648. You need to downgrade boto3 version in your lambda. For this include a lower version of boto3 in your requirements.txt file. For example, boto3==1.26.90 worked for me. Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With