AWS Numpy Runtime.ImportModuleError: Unable to import module 'lambda_function': Unable to import required dependencies: numpy:

0

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.24.2"

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

AND What does this defines The Python version is: Python3.9 from "/var/lang/bin/python3.9"

Mayur
已提問 1 年前檢視次數 3783 次
1 個回答
1
已接受的答案

Hi,

the issue could be due to many reasons:

Hope it helps ;)

profile picture
專家
已回答 1 年前
  • How can I create a layer to invoke my lambda function. Means where I have to write --- pass a list of dependencies included with the layer metadata.

    { "dependencies": { "requests": "latest", "numpy": "== 1.20.1", "keyring": ">= 4.1.1" }, "layer": { "name": "a-sample-python-lambda-layer", "description": "this layer contains requests, numpy and keyring libraries", "compatible-runtimes": ["python3.6","python3.7","python3.8"], "license-info": "MIT" } }

    You can create a layer to invoke your Lambda function and pass a list of dependencies included with the layer metadata.

    The following example creates Python Lambda layers containing requests (latest version), numpy (version 1.20.1), and keyring (version >= 4.1.1) libraries. You can invoke the Lambda function with a payload similar to the following:

    AND What does this defines The Python version is: Python3.9 from "/var/lang/bin/python3.9"

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南