I've been trying to move some python code I've written into AWS Lambda. It's a CSV validator that uses the 'pycsvschema' library, and works perfectly on my local PC. I had to do some finicking with downloading the library onto a lambda layer, but it seems to work on that level. The problem is, now I'm getting this error in CloudWatch logs:
"Runtime.ImportModuleError: Unable to import module 'lambda_function': No module named 'rpds.rpds'".
I have no idea why this error is here, and especially have no idea on how to fix it.
I vaguely understand that 'rpds' is used by the JSONSchema library, which in turn is used by the library I want to use. I've checked and both 'rpds' and 'JSONSchema' are within the zip file that the AWS layer takes libraries from. But I have no idea what it does, and where to start in fixing this error. Could anybody help?
Chances are you've bundled an rpds for the wrong interpreter version or CPU architecture.
I had the same issue and that was exactly the reason. PIP was run on CI container and RPDS was bundled for architecture and linux version tied to this container, not AWS lambda runtime. For AWS lambda ( x86, linux ) proper RPDS is rpds_py-0.18.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl ( PIP fetched x86_64-linux-musl )
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