Im running a python script on aws lambda and its throwing the following error.
{
"errorMessage": "Unable to import module 'app': urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with OpenSSL 1.0.2k-fips 26 Jan 2017. See: https://github.com/urllib3/urllib3/issues/2168",
"errorType": "Runtime.ImportModuleError",
"stackTrace": [] }
It was running perfectly an hour ago , and even after I have made no deployments , it seems to be failing.
my python version is 3.7.
and Im only using urllib to parse and unquote urls .
namely
from urllib.parse import urlparse
and
from urllib.parse import unquote
like its mentioned in the GitHub url I can upgrade my python version, but doing so would break other things.
Are there any alternative librries I can use to get the same result?
from the GitHub link , it shows urllib no longer supports OpenSSL<1.1.1 but somehow some of our higher environments the same scripts is running without issues.
2
Answers
specifying my urllib3 to 1.26.15 in the requirement.txt file based on this https://github.com/urllib3/urllib3/issues/2168#issuecomment-1535838106 thread fixed this error.
You can resolve it by specifying the lower version of urllib in your requirements.txt file.