New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Importing the numpy c-extensions failed.' in AWS Lambda deployed to IoT GreenGrass with Pandas import #14532
Comments
I tried following the suggestion from this similar issue, specifically I downloaded the pre-compiled versions of pandas and numpy from here. This didn't resolve it though, now I get this error:
|
I have a similar problem when working with PyInstaller to create an app. I get the same error message, but it says "Check that you expected to use Python2.7 from "/usr/bin/python",". this is weird, cause I'm running Python3.7 and I've installed numpy with pip3. When opening "Setup.py" for Numpy I realize it starts with "#!/usr/bin/env python" which should indicate a python 2.7 installation. Changing this line to "#!/usr/bin/env python3.7" solves nothing and the message remains unchanged. My Nympy version is "1.17.2" and I working within a virtual environment. In console I thing this is the corresponding error: When running the app I get:
As you can see I don't pass checkpoint one, but I have no idea about how to change the reference to Python 2.7. I have both 2.7, 3.6 and 3.7 installed and I have a Mac with MacOs Mojave version 10.14.6. Anyone has a suggestion on how to get around this? Kind regards, Christian |
I'm in the same boat. I'm adding a Lambda Layer with python stats START RequestId: e876b0a0-2cf9-47f6-91df-7b8d798572eb Version: $LATEST IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE! Importing the numpy c-extensions failed.
I wonder if it's a shared lib incompatibility? This zip file sent up |
So I was able to solve the problem thanks to the help of the great community here. Using |
@OscarVanL were you able to properly install numpy into your lambda instance? |
Yes!
It all came down to installing the packages on a matching instance type using the --target=<dir> argument for pip3.
Then zip that dir and install/upload via lambda console
The path in the zip file must start with “python/“.
… On Dec 11, 2019, at 9:44 AM, Matti Picus ***@***.***> wrote:
@OscarVanL <https://github.com/OscarVanL> were you able to properly install numpy into your lambda instance?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#14532?email_source=notifications&email_token=AACY7PB6AKKH5AQD6WUBJCLQYEKH3A5CNFSM4IXN3XRKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGTZOGA#issuecomment-564631320>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AACY7PG2PTGMHFY7SQRUKLDQYEKH3ANCNFSM4IXN3XRA>.
|
@iceback thanks for the update and hint, but this issue was opened by @OscarVanL |
Apologies for never replying to this issue. I'm no longer working on this, so can't say if the previously mentioned workarounds work for me or not. |
@vishalsharai-trail how did you install sudo apt-get install libatlas-base-dev in lambda function? |
I had a similar problem and fixed it this way |
Use Klayers package from this link- https://github.com/keithrozario/Klayers |
my form looks different from yours, how did you fix it? |
I'm deploying an AWS Lambda Function to an edge device with IoT GreenGrass, when my function runs it has a problem with my
import pandas
requirement giving an error related to numpy.See this thread on the AWS GreenGrass forums
Reproducing code example:
(Numpy is a dependency of pandas)
I've written this using the AWS Toolkit for PyCharm, inside that there's a requirements.txt file listing numpy and pandas. The SAM build process has been set to complete in a container so as to avoid using numpy/pandas compiled for Windows.
Error message:
Here's the log file:
Numpy/Python version information:
Python 3.7
Numpy version unknown since I cannot import numpy to print its version.
It's quite possible this error is related to some proprietary gubbins Amazon is doing, between deploying it with SAM (Serverless Application Model) and then deploying it to an IoT device with IoT GreenGrass, perhaps some weird stuff has happened. I've created this issue so I can link to it in a bug report to Amazon.
The text was updated successfully, but these errors were encountered: