Importing LightGBM into lambda function

0

I have a lambda function that's linked to an EFS where I'm storing dependencies such as Numpy and LightGBM.

I have the following line of code in the lambda function to add the dependency directory to the system path: sys.path.append("/mnt/access/site-packages")

I have no issue importing Numpy, but when I try to import LightGBM I get the following error: "libgomp.so.1: cannot open shared object file: No such file or directory"

I think the error occurs because AWS Linux 2 is missing libgomp.so.1, but I'm not sure how to make it available to my lambda function.

hczhang
posta un anno fa502 visualizzazioni
1 Risposta
0

Hi, you should first validate that libgomp.so.1 exists in the container image of the Lamdda runtime.

If Yes, It may well be a LDPATH issue. Then, update LD_LIBRARY_PATH with ENV LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH in Docker file and in lambda added env variable LD_LIBRARY_PATH=/usr/lib64

To do that, you may have to build your own custom Docker container image. See https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html to see where to start to build this specific container image

If No, then you'll have to additionally add the package libgomp1 before doing the above.

Hope it helps!

Didier

profile pictureAWS
ESPERTO
con risposta un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande