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"

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则