When I try to run a python code on Lambda functions I got an error message related with regex module.

0

How can I fix the following issue?

[ERROR] Runtime.ImportModuleError: Unable to import module 'analysis': No module named 'regex._regex' Traceback (most recent call last):

I have tried to apply all recommendations available on AWS pages and Stackflow site, but I did not have success. Python version: 3.10 Python modules on code: TextBlob and Pymongo

질문됨 일 년 전422회 조회
2개 답변
1

The error indicate that your deployment package is missing the regex dependency. To include it you should create a zip file that contains all dependencies. I would recommend using SAM to manage all the resources you need. Use sam init to create the project, sam build to build it, including all the dependencies, and sam deploy to deploy to your account.

profile pictureAWS
전문가
Uri
답변함 일 년 전
0

Lambda requires you to prepare your own Lambda if it is not included in the standard modules.
You will need to create layers and upload the necessary modules as described in the following document.
https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html

profile picture
전문가
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠