pendulum
pendulum copied to clipboard
Pendulum with AWS Lambda, cannot use the module.
- [x] I am on the latest Pendulum version.
- [x] I have searched the issues of this repo and believe that this is not a duplicate.
- AWS Lambda Python 3.6:
- pendulum-2.1.0:
Issue
I've tried to find help on Reditt Python sub before posting an issue here. I have a simple lambda function where I need to use Pendulum package.
import pendulum
def lambda_handler(event, context):
print(pendulum.now())
The error I get is
"errorMessage": "module 'pendulum' has no attribute 'now'"
This code works fine locally.
import pendulum
print(pendulum.now())
I've tried to do maximum debugging I knew. These are the results of it. Locally:
import pendulum
print(pendulum)
OUTPUT: <module 'pendulum' from '/path/archive_date/.package/pendulum/__init__.py'>
On Lambda output is:
OUTPUT: <module 'pendulum' (namespace)>
I still guess that I am doing something wrong here.
I've just seen this on a Raspberry Pi and got round it with this:
$ pip install --no-binary=pendulum pendulum