Importing pandas throws numpy error (Amplify)

0

Importing pandas throws numpy error (Amplify) after Amplify push, the lambda is created but running a test fails with the below error:

[ERROR] Runtime.ImportModuleError: Unable to import module 'index': Unable to import required dependencies: numpy: Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch your python interpreter from there. Traceback (most recent call last):

this is how I'm importing pandas in my lambda:

import pandas as pd

relevant solutions:

  1. use aws pandas layers lambda --> I cant use this
  2. download architecture specific binaries --> when I use this command: pipenv install --platform==manylinux1_x86_64 pandas, it throws error saying: pipenv.patched.pip._internal.exceptions.InstallationError: Invalid requirement: '--platform==manylinux1_x86_64'

how else can i solve this error in my amplify lambda ?

preguntada hace 5 meses420 visualizaciones
1 Respuesta
0
Respuesta aceptada

the only way I found working is to use the AWS-provided Pandas lambda layer

respondido hace 5 meses

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