0
votes

i have problem with setting up python script on aws lambda function for IBM MQ client. The things I did:

  1. I install IBM MQ client on Ubuntu linux server and there I installed pymqi with pip install pymqi
  2. I zipped MQ installation path (/opt/mqm) and pymqi in same zip file
  3. I uploaded this zip on AWS lambda layer
  4. then I created new lambda function and add layer and wrote in function code "import pymqi"
  5. 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'"

1
Could be how you are setting 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. - chughts
Can you pleasae tell me what excatly do you mean? :) - jan
When a pip install of the pymqi library 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. So LD_LIBRARY_PATH needs 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 setting LD_LIBRARY_PATH - chughts
You resolved this on the pymqi issues list right? Can you post an answer? - JoshMc

1 Answers

0
votes