Skip to content

issue in deploying pandas_ta library

0

Hi, I am trying to add a layer for pandas_ta library on AWS Lambda function. I tried in different python version 3.8 to 3.12 adding layer, however, when execting the code lambda throws erros "Unable to import module 'lambda_function': No module named 'pandas_ta'"

Same code when executed in pycharm, it is working fine.

below are steps im following to add lib lambda -> layer -> create layer - > uploading 'panda_ta' zip file - > compatible version (selected 3.8 to 3.12) -> create once layer is created, in lambda function adding it to the layer

your guidance is much appreciated

Thanks & Regards Madan Durai

asked 2 years ago308 views
1 Answer
0
Accepted Answer

Hi Madan,

You can look at the doc[1] to learn about the Layer paths for each Lambda runtime, for example Python is below: pillow.zip │ python/PIL └ python/Pillow-5.3.0.dist-info

So your zip structure should be : panda_ta.zip │ python/panda_ta

[1]https://docs.aws.amazon.com/lambda/latest/dg/packaging-layers.html#packaging-layers-paths

answered 2 years ago
  • Thank you very much Charles. I was following the same method you mentioned, however, there was panda_ta distro folder and i did not include in the zip file. Tried now including pandas_ta distro file and created zip file. now it is working find. Thanks once again charles

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.