skip to Main Content

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


  1. Chosen as BEST ANSWER

    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.


  2. You can resolve it by specifying the lower version of urllib in your requirements.txt file.

    requests
    urllib3<2
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search