1
votes

I have done pip install --target ./package retry and then packaged my code and ./package folder in to a zip and uploaded it to AWS lambda. However, from package.retry import retry results in :

{ "errorMessage": "Unable to import module 'lambda_function_update_error_table': No module named 'packageretry'", "errorType": "Runtime.ImportModuleError" }

But, if the retry folder which is installed through pip is in root directory, from retry import retry works fine.

How can I solve this issue? Thanks in advance!!

1
Check if that version of python the package is available. If not, use a different version of Python or look for alternatives. - Luigi Lopez
I suspect No module named 'packageretry' indicates a typo in your actual code. - iBug

1 Answers

0
votes

Try downloading the .whl file and then after manually extracting it again zip it with your lambda code. now once you deployment package is ready upload it to the Lambda function and then try again.

you can get the .whl file form https://pypi.org/search/?q=retry