'AWS Lambda - AwsWrangler - Pandas/Pytz - Unable to import required dependencies:pytz:

To get past Numpy errors, I downloaded this zip awswrangler-layer-1.9.6-py3.8 from https://github.com/awslabs/aws-data-wrangler/releases.

I want to use Pandas to convert JSON to CSV and it's working fine in my PyCharm development environment on Windows 2000.

I have a script that builds the zip for my "deploy package" for Lambda. I create a new clean directory, copy my code in it, then copy the code from awsrangler into it.

At that point, I stopped getting the errors about Numpy version, and started getting the error below.

Error:

[ERROR] Runtime.ImportModuleError: Unable to import module 'AwsS3TriggerQuotesJsonToCsv': Unable to import required dependencies:pytz: No module named 'pytz'

What I don't understand is that pytz is in awsrangler and my distribution.

enter image description here

I'm using Python 3.8 on AWS, since that is higher version of wranger: awswrangler-layer-1.9.6-py3.8.

My first attempt I only included Pandas and Numpy modules. Second attempt was to also include the pytz module, same error. Third attempt, I included everything from awswrangler-layer-1.9.6-py3.8/python, even though I didn't need it all, but yet same error.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source