You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.
When I run the function I get the following error [ERROR] Runtime.UserCodeSyntaxError: Syntax error in module 'main': unknown encoding for '/var/task/main.py': future_fstrings Traceback (most recent call last): File "None" Line None None
Assuming main.py contains my lambda function code
If I include the future_strings in same folder as my code then it works.
AWS Lambda puts the shared libraries in /opt/ folder and I am dynamically adding opt directory to sys path sys.path.insert(0, '/opt') Doing this way it throws error.
I do not know the internals how the library converts and when does the conversion code triggers but my hunch is I am doing something wrong here.
The text was updated successfully, but these errors were encountered:
Reproduction Steps
1> Create a Lambda Function(https://docs.aws.amazon.com/lambda/latest/dg/getting-started-create-function.html)
2> Create a layer and associate it with your lambda created in Step 1(https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). The purpose of layers is to have a shared library across multiple AWS Lambda functions. So here I am putting the future-fstrings library as a part of my zip file which is uploaded as AWS layer.
When I run the function I get the following error
[ERROR] Runtime.UserCodeSyntaxError: Syntax error in module 'main': unknown encoding for '/var/task/main.py': future_fstrings Traceback (most recent call last): File "None" Line None None
Assuming main.py contains my lambda function code
If I include the future_strings in same folder as my code then it works.
AWS Lambda puts the shared libraries in /opt/ folder and I am dynamically adding opt directory to sys path
sys.path.insert(0, '/opt')
Doing this way it throws error.I do not know the internals how the library converts and when does the conversion code triggers but my hunch is I am doing something wrong here.
The text was updated successfully, but these errors were encountered: