Open Ryan-Daly opened 4 years ago
Just tested it on us-east-1
and can confirm same error
I suspect it doesn't have opencv itself, and not just the headless bit. Let me check.
If I change the Python version to 3.7 it does say there is no module cv2
Are there perhaps any updates on this bug? I'm running into the same error for this layer
Sorry guys, haven't had time to look into this. Overall, we just pip install the package, and zip that up into a layer.
I suspect in order to use this, we'll need that shared-object file which isn't installed with pip. :(
Gotcha, thank's for the heads up 👍
I'm having the same issue.
opencv-python-headless
depends on a native library (libglib
), and AFAIK it's not possible to create a Lambda layer which installs system dependencies for Lambda.
Is there a workaround? I know that this exists, but generating a shared library on an Amazon Linux EC2 instance to ship it later in a ZIP archive for a Lambda function seems... Not very robust? I mean if that's the only way to get it to work, I'll try!
FIX:
I created a new layer that contains the missing dependencies, would you mind testing it out.
The layer arn is:
arn:aws:lambda:
If you include both the opencv layer and the layer above, the error message no longer appears.
more info here (for further reference): https://www.keithrozario.com/2021/08/missing-so-files-in-lambda-functions.html
Describe the bug OpenCV Headless isn't working with Lambda Layers. Getting an error:
Lambda function:
Layer Version ARN: arn:aws:lambda:eu-west-2:770693421928:layer:Klayers-python38-opencv-python-headless:11
Framework: Console