Error while running python code in aws lambda function:

0

While running aws lambda function for a lex document based chatbot code i am getting error(i have imported a layer for langchain module).

Error:

Response { "errorMessage": "Unable to import module 'lambda_function': urllib3 v2 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": [] }

2 Answers
0

Hi,

Specifying your dependencies in requirements.txt is not sufficient.

Lambda runtime supplies a limited set of 3rd-party Python packages. You have to add the missing ones by yourself.

Follow this guidance to do it for urllib3: https://docs.aws.amazon.com/lambda/latest/dg/python-package.html

Best,

Didier

profile pictureAWS
EXPERT
answered 4 months ago
  • I have already added python packages from layers, last i did for langchain module after that i am getting error.

0

Hello.

Please try creating a layer by specifying "urllib3==1.26.15" in "requirements.txt" as described in the GitHub issue below.
https://github.com/lithops-cloud/lithops/issues/1104

profile picture
EXPERT
answered 4 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions