i have problem with setting up python script on aws lambda function for IBM MQ client. The things I did:
- I install IBM MQ client on Ubuntu linux server and there I installed pymqi with pip install pymqi
- I zipped MQ installation path (/opt/mqm) and pymqi in same zip file
- I uploaded this zip on AWS lambda layer
- then I created new lambda function and add layer and wrote in function code "import pymqi"
- In enviroment variables I added LD_LIBRARY_PATH = /opt/mqm/lib64
I get next error: "errorMessage": "Unable to import module 'lambda_function': No module named 'pymqe'"
LD_LIBRARY_PATH. Refer to AWS documentation on how to add to it - docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html - it needs to be set before the pymqi c libraries are built, and also for your lambda function.pymqilibrary is performed, it also creates c object code to interact with. For this compile it needs access to a c compiler, the mq c headers, and object libraries. So all have to be already on the machine, configured and locatable. SoLD_LIBRARY_PATHneeds to be already set. AWS like many cloud platforms limits which environment variables are inherited by spawned systems. Hence you need to read the AWS documentation on settingLD_LIBRARY_PATH