1

I need to use AWS Data Wrangler, NumPy and SciPy in one AWS Lambda.

To make it possible I use two Layers:

  • Layer provided by AWS: AWSLambda-Python38-SciPy1x - AWS Lambda SciPy Layer for Python38 (scipy-1.5.1, numpy-1.19.0)
  • Custom Layer created from awswrangler-layer-2.9.0-py3.8.zip

My AWS Lambda function looks like this:

def lambda_handler(event, context):
    import awswrangler as wr

And the error I receive:

RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
[ERROR] ImportError: numpy.core.multiarray failed to import

I there a way I could make it work?

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
alex
  • 10,900
  • 15
  • 70
  • 100
  • Can you create a reproducible somehow? – Gulzar Jun 25 '21 at 13:13
  • @Gulzar, isn't this reproducible? Create a Lambda with code like shown, add two above Layers and run. You should get the error. – alex Jun 25 '21 at 14:34
  • What should I copy-paste and run? How to call it? What to install and *exactly* how? Maybe I am not following, but I don't think this can be easily reproduced without some setup. – Gulzar Jun 26 '21 at 10:13
  • @Gulzar In AWS Console find Lambda, click _create_, in the _Code_ tab paste those two lines of code. At the bottom there is a menu called _Layers_ where you have a GUI to add those Layers. Then click a green _Test_ button. There's not really much more to it. – alex Jun 26 '21 at 10:27
  • I still get this too - any advance on it? – jtlz2 Aug 17 '22 at 08:33

0 Answers0