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 ?

asked 4 months ago373 views
1 Answer
0
Accepted Answer

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

answered 4 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions