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 ?

1回答
0
承認された回答

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

回答済み 5ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ