'AWS lambda: RequestsDependencyWarning: urllib3 (1.26.6) or chardet (3.0.4) doesn't match a supported version

I have an AWS lambda program that is getting this warning in logs:

/var/task/requests/init.py:89: RequestsDependencyWarning: urllib3 (1.26.6) or chardet (3.0.4) doesn't match a supported version!

I have tried fixes mentioned in other threads such as this one but have not been able to resolve this

The odd thing is that in my virtualenv, I have:

chardet==4.0.0
urllib3==1.25.10

... but the warning is complaining about chardet 3.0.4 and urllib 1.26.6. Wondering if this could have something to do with packages being provided by the AWS Lambda environment. I assume that my packages override the defaults they have.



Solution 1:[1]

it may be because of an outdated "requests"

try to upgrade request with pip3 install --upgrade requests

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 dominix