Oh my. After, I can't tell you how many medium posts, stack overflows, and rubbish AWS documentation I've trawled through, nothing was successful except this. THANK YOU.
@@DataEngUncomplicated I've already linked this video on two stack overflows. Seriously, I can't understand why the AWS documentation is so appallingly crap and gave no idea as to the steps you gave here. Yours is such a short but perfectly put together video.
You're a life savior my guy, thank so much for this. I struggled for days trying a bunch of different solutions without any success until i got here. Happy 2022 btw
@@DataEngUncomplicated Hi Adriano, referenced this guide again today for another library and it worked like a charm! One question, what is the purpose of pytz library? Is it necessary to always include it in our custom layer package? Thank you :)
For the error: 'wheel' is not recognized as an internal or external command, I fixed mine by running "pip install --upgrade wheel". I also changed my command prompt to point to my python scripts directory.
Worked for numpy issue BTW On this date I didn't had to create custom layer for pandas as well I attached AWSDataWrangler... inbuilt layer and it resolved issue of pandas and numpy import
Hi Parth, AWS has added an input layer for AWS Data Wrangler which is great but I don't think it's available for all python versions. Also If you need to lock in pandas at a specific version then you may still want to create a custom layer or you are going to be stuck with whatever version aws data wrangler is using.
Now AWS includes AWSSDKPandas-Python312 so it's easier to add pandas to your Lambda function. However, I'm getting "Missing optional dependency 'fsspec'. Use pip or conda to install fsspec." I've follow these steps to install the latest version, but failed: "Unable to import module 'lambda_function': No module named 'fsspec'". Any suggestions?
I had the same situation. It was because the lambda fun Runtime was Python 3.9 .. Once you change your Runtime to Python 3.7, the option will be available on dropdown.
For those who want to stay at Python 3.9, is there another whl file required besides the one for numpy to make this work? like how we needed to grab the pandas whl file and the pytz whl file?
Thanks it helped me a lot! One question, do you have a video how to import/install your own built python package to aws lambda? I mean if you have a file with setup.py and everything what is needed
Hi ladislav, glad this was helpful. Unfortunately I don't have a video on how to install your own built python package to aws lambda but this seems like a great idea for a future video. I'm going to add it to my future list.
I am still facing with the numpy import error and even used AWSLambda-Python38-SciPy1x library , but unable to resolve , kindly let me know if any inputs
Hello, I did the same thing but for scikit-learn. When I do the command in the lambda function from sklearn.model_selection import train_test_split it returns a module error, "No module called sklearn", any fixes?
Hi There , Thank you for your great video and training first. When I am running the "wheel unpack", it is returned the error of "access is denied" in my Windows Command line, could you help to shed some lights on this , thank you in advance
Hi India, Make sure the pandas wheel version matches the version you are using on lambda. For example, if you want to use python 3.7 on lambda, make sure to download the 3.7 wheel version of pandas. I'm not sure if this will solve this exact issue but worth a try.
FYI if anyone is watching this in 2024, you can just add the pandas layer without uploading anything. Skip to the end where he is adding the "numpy" layer. It's the same now for pandas.
Correct, the aws sdk for pandas layer comes with pandas. However, this tutorial is relevant if people can't use lambda layers for whatever reason or need a specific version of pandas they need to install.
@@DataEngUncomplicated @larie22 I want to use scikit learn package ,should I make custom layer for scikit learn and use along with aws provided layers for pandas and numpy?
I encountered the same issue. However, I solved it by choosing the proper python version. For example, if your lambda function use runtime Python 3.8, then you must use the right wheel package of cp38. Hope this would help.
Hi sso, did you link the lambda layer to your python function? there are a few places where if a step was done incorrectly, it won't recognize pandas python library that was uploaded as a lambda layer.
Hi Ravi, the zip file will become out of date as new versions of pandas is being released. Unfortunately I don't have the capacity to maintain all these versions
Hi Khushi, There should be no relationship between your python version on your Windows machine and what version of python runtime you want to use in AWS Lambda. Make sure you download the correct Pandas version to match the lambda runtime you want to use.
I HAVE THIS ERROR : Response { "errorMessage": "Unable to import module 'app': No module named 'pandas._libs.interval'", "errorType": "Runtime.ImportModuleError", "stackTrace": [] }
Hi Zouaoui, Make sure the pandas wheel version matches the version you are using on lambda. For example, if you want to use python 3.7 on lambda, make sure to download the 3.7 wheel version of pandas.
Oh my. After, I can't tell you how many medium posts, stack overflows, and rubbish AWS documentation I've trawled through, nothing was successful except this. THANK YOU.
Haha you're welcome nick! I'm glad you got it working.
@@DataEngUncomplicated I've already linked this video on two stack overflows. Seriously, I can't understand why the AWS documentation is so appallingly crap and gave no idea as to the steps you gave here. Yours is such a short but perfectly put together video.
You're a life savior my guy, thank so much for this. I struggled for days trying a bunch of different solutions without any success until i got here. Happy 2022 btw
Happy 2022 Bruno! I'm glad you got it working! Thanks for the feedback 😊
Thank you for the step-by-step instructions
Holy shit, I spent days trying to figure out how to get “numpy” installed. Awesome video !
Thanks Dave!
Your videos are great. Thank you very much.
Thanks for the kind words
the only you tuber who makes sense. kudos and great success be upon you!
Haha thanks Navesh, I'm glad my video was helpful
Informative videos… 👌🏻… looking forward for more
Thank you Abhinav!
OMG... ur awesome... i just followed u step by step and it resolved my issue.. thanks a lot dude 😊
Haha thanks! You're welcome Shrinidhi! Glad you got it working!
Thanks buddy,It helps me alot. It covers everything I need.
You're welcome!
Awesome content! Thanks. Followed same instructions to get ndjson package layer in.
Thanks Martin! I'm glad it put you on a path for another package to work!
@@DataEngUncomplicated Hi Adriano, referenced this guide again today for another library and it worked like a charm! One question, what is the purpose of pytz library? Is it necessary to always include it in our custom layer package? Thank you :)
Thank you for great tutorials, after two day struggling I found you video and solve my problem
Thank you Amir! I'm glad you got pandas installed successfully!
For the error: 'wheel' is not recognized as an internal or external command, I fixed mine by running
"pip install --upgrade wheel". I also changed my command prompt to point to my python scripts directory.
Thanks for sharing!
@@DataEngUncomplicated Thanks for your video! It saved me a ton of time!
Thank you, you are a life saver.
You're welcome!
Useful instruction👍 It assisted me with running lambda python codes.
Thanks for the comment Mengcen!
Worked for numpy issue
BTW On this date I didn't had to create custom layer for pandas as well
I attached AWSDataWrangler... inbuilt layer and it resolved issue of pandas and numpy import
Hi Parth, AWS has added an input layer for AWS Data Wrangler which is great but I don't think it's available for all python versions. Also If you need to lock in pandas at a specific version then you may still want to create a custom layer or you are going to be stuck with whatever version aws data wrangler is using.
Now AWS includes AWSSDKPandas-Python312 so it's easier to add pandas to your Lambda function. However, I'm getting "Missing optional dependency 'fsspec'. Use pip or conda to install fsspec." I've follow these steps to install the latest version, but failed: "Unable to import module 'lambda_function': No module named 'fsspec'". Any suggestions?
Thank you very much! This helped me a lot!
You're welcome David! I'm glad it was helpful.
Fantastic help! Thank you so much!
You're welcome! Glad it was helpful.
Thanks man it worked. :)
Thanks for sharing, but I can't find AWSLambda-Python37-SciPy1x Layer in down list
Hi Ahmed, make sure you are not searching in "custom layers" This is a layer that is provided by AWS.
I had the same situation. It was because the lambda fun Runtime was Python 3.9 .. Once you change your Runtime to Python 3.7, the option will be available on dropdown.
For those who want to stay at Python 3.9, is there another whl file required besides the one for numpy to make this work? like how we needed to grab the pandas whl file and the pytz whl file?
wheel is not recognized as internal external cmd error
I fixed mine by running "pip install --upgrade wheel". I also changed my command prompt to point to my python scripts directory.
this is great, thank you very much!
You're welcome Sebastian.
I'm getting an error "errorMessage": "Unable to import module 'lambda_function': No module named 'pandas._libs.interval'",
Thank you so much! Clear and easy easy to follow
Thanks Joe!
Thanks it helped me a lot! One question, do you have a video how to import/install your own built python package to aws lambda? I mean if you have a file with setup.py and everything what is needed
Hi ladislav, glad this was helpful. Unfortunately I don't have a video on how to install your own built python package to aws lambda but this seems like a great idea for a future video. I'm going to add it to my future list.
I am still facing with the numpy import error and even used AWSLambda-Python38-SciPy1x library , but unable to resolve , kindly let me know if any inputs
Strange, sorry it worked for me and others from the lambda layer I selected. Try selecting the specific version I had perhaps?
Hello, I did the same thing but for scikit-learn. When I do the command in the lambda function from sklearn.model_selection import train_test_split it returns a module error, "No module called sklearn", any fixes?
Hi, I 'm not familiar with the installation process for scikit-learn. maybe check our their documentation page to see what you are missing?
Thanks so much.
Just making sure people wont have issues as I did, but at 3:10, the folder name MUST be python otherwise it wont work.
You're welcome! Great call out.
I followed the same process but getting the error : Unable to import module 'lambda_function': No module named 'pandas'
Hi, it should work. It's possible you downloaded the wrong file?
thanks man love you 3000 i was able to upload custom package and sove my problem
You're welcome my friend! I'm glad it was helpful!
Hi There , Thank you for your great video and training first. When I am running the "wheel unpack", it is returned the error of "access is denied" in my Windows Command line, could you help to shed some lights on this , thank you in advance
Hi Jason, yes, it looks like you don't have access to that location on your machine.
This was very helpful..
Thanks Vijendrr!
I got an "errorMessage": "Unable to import module 'lambda_function': No module named 'packaging'", I don't know what to do?
Hi India, Make sure the pandas wheel version matches the version you are using on lambda. For example, if you want to use python 3.7 on lambda, make sure to download the 3.7 wheel version of pandas. I'm not sure if this will solve this exact issue but worth a try.
I am not able to unpack wheel file using wheel file it is telling me that wheel is not recognized as internal/external command
Hey, do you have the library installed to unpack the wheel file?
awesome ... great stuff
Thanks Muhantesh!
why i am getting error saying unable to import required dependencies :
numpy : module error named : numpy
You missed the step in the video to handle that issue that comes up.
@@DataEngUncomplicated thanks you so much pointing that out
FYI if anyone is watching this in 2024, you can just add the pandas layer without uploading anything. Skip to the end where he is adding the "numpy" layer. It's the same now for pandas.
Correct, the aws sdk for pandas layer comes with pandas. However, this tutorial is relevant if people can't use lambda layers for whatever reason or need a specific version of pandas they need to install.
@@DataEngUncomplicated @larie22 I want to use scikit learn package ,should I make custom layer for scikit learn and use along with aws provided layers for pandas and numpy?
THANK YOU!
You're welcome John!
No module named 'pandas._libs.interval' not built
Hi Guilherme, what version of pandas were you trying to install? I have not seen this error before.
I encountered the same issue. However, I solved it by choosing the proper python version. For example, if your lambda function use runtime Python 3.8, then you must use the right wheel package of cp38. Hope this would help.
@@mengcenli9890 Thanks for leaving this note, I'll make sure to pass this along if someone else has the same issue.
Good god you were made to teach homie
Haha thanks, I appreciate the kind words!
It didn't work for me... I followed your tutorial but it still shows error message "no module named pandas"
Hi sso, did you link the lambda layer to your python function? there are a few places where if a step was done incorrectly, it won't recognize pandas python library that was uploaded as a lambda layer.
insted of all these you could have placed the zip file link in the description
Hi Ravi, the zip file will become out of date as new versions of pandas is being released. Unfortunately I don't have the capacity to maintain all these versions
we have to download only wheel file? Then what about .tar.gz
Correct, we only need to download the wheel file and unpack it. You can ignore the .tar.gz file.
Thanks a lot!
You're welcome!
can you please tell if I have python version 3.9 in my windows so I have to choose python 3.9 runtime in AWS lambda?
Hi Khushi, There should be no relationship between your python version on your Windows machine and what version of python runtime you want to use in AWS Lambda. Make sure you download the correct Pandas version to match the lambda runtime you want to use.
@@DataEngUncomplicated ya I did it but when I uploaded zip file it failed to create the layer.
As mentioned in the video, make sure you are downloading the Linux distribution and not the windows one since lambda does not run on windows machines
@@DataEngUncomplicated Okk I will try with that again. Thanks.
very helpful :)
Thanks for the feedback Queanbeyan.
I HAVE THIS ERROR :
Response
{
"errorMessage": "Unable to import module 'app': No module named 'pandas._libs.interval'",
"errorType": "Runtime.ImportModuleError",
"stackTrace": []
}
Hi Zouaoui, Make sure the pandas wheel version matches the version you are using on lambda. For example, if you want to use python 3.7 on lambda, make sure to download the 3.7 wheel version of pandas.
@@DataEngUncomplicated exactly i changed the version and it works thank's
Thank you very much! This helped me a lot!
You're welcome. I'm glad it was helpful!
Thank you!!!