Back
I'm writing a lambda function that works with datetimes and trying to import pytz so I can have timezone be accounted for when comparing.
import boto3import pytzfrom datetime import timedelta, date, datetimefrom boto3.dynamodb.conditions import Key, Attr
import boto3
import pytz
from datetime import timedelta, date, datetime
from boto3.dynamodb.conditions import Key, Attr
causes this to display
{errorMessage=Unable to import module 'lambda_function'}
but when I remove import pytz the function fires (it just doesn't work properly without timezone info)
Inside the directory where you are going zip and upload it to your AWS application.
pip install -t path/to/your/lambda pytz
After that, when you ZIP and upload, it will be working.
Learn how we helped 50,000+ professionals like you !
31k questions
32.8k answers
501 comments
693 users