I have a serverless service that I want to be able to use the sasl
pypi package from in AWS Lambda. Unfortunately, the AWS Lambda environment doesn't seem to have the newest versions of libstdc++.so, which means that when our build server zips up the pip install
'd sasl package and we invoke the lambda, there are the expected errors:
Unable to import module 'handler': /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /var/task/sasl/saslwrapper.so)
My question is: How to get around this?
Is there a way to build these on an Amazon Linux instance against updated libstdc++.so.6 so that it can be bundled in with the libs? Would setting LD_LIBRARY_PATH
env variable to .
and including the newest version of libstdc++.so.6 work? Are there best practices around this anywhere?
You can use docker with amazonlinux
as your base image to build all your dependencies then copy these to your zipped package to be uploaded to your actual lambda: https://medium.com/@johnnyopao/python-dependencies-and-aws-lambda-18acbdebca20
Or you can do the equivalent on a remote EC2 (build) instance: http://www.perrygeo.com/running-python-with-compiled-code-on-aws-lambda.html
Last option, use AWS Cloud 9 as your IDE, as suggested by: https://markn.ca/2018/02/python-extension-modules-in-aws-lambda/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With