I am trying to use the sagemaker SDK within a lambda, which depends on numpy.
I am aware that numpy needs some extra steps to work within lambda given its reliance on compiled binaries, so I followed the guides below to try and create a lambda layer that can successfully add numpy as a dependency to my lambda:
Serverless - Numpy - Unable to find good bind path format AWS Lambda and python numpy module https://medium.com/@shimo164/lambda-layer-to-use-numpy-and-pandas-in-aws-lambda-function-8a0e040faa18
I have made sure that I created my layer zip file on a linux machine so that the compiled binaries would be for the correct OS. I've also made sure that the layer zip is within lambda's deploy requirements. However, when I try to import sagemaker
within my lambda, I get the following error:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.9 from "/var/lang/bin/python3.9"
* The NumPy version is: "1.21.6"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: No module named 'numpy.core._multiarray_umath'
I am not sure what else to try at this point. Every other guide I find is a variation of the links I've posted above. What am I doing wrong?