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:
- use aws pandas layers lambda --> I cant use this
- 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 ?
Then you have come further than I have. I have also failed at that! Pls see my Q here: https://repost.aws/questions/QUfCQB2gwtQeGAMoJ_ioRqLw/aws-managed-lambda-layer-for-panda-seems-to-fail-in-cloudformation