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
preguntada hace un año3783 visualizaciones
1 Respuesta
1
Respuesta aceptada

Hi,

the issue could be due to many reasons:

Hope it helps ;)

profile picture
EXPERTO
respondido hace un año
  • 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"

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas