Skip to content

Cannot use the extras lambda layer #290

Closed
@FredrikMeyer

Description

@FredrikMeyer

I'm trying to use the extras layer, but I get a error message:

[ERROR] Runtime.ImportModuleError: Unable to import module 'main': No module named 'pydantic'

Expected Behavior

Be able to import the parser module without also installing pydantic.

Current Behavior

Pydantic is not included in the layer.

Steps to Reproduce (for bugs)

My SAM template:

  MyFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: ./my_function
      Handler: main.handler
      Runtime: python3.8
      Layers:
        - !GetAtt AwsLambdaPowertoolsPythonLayer.Outputs.LayerVersionArn

  AwsLambdaPowertoolsPythonLayer:
    Type: AWS::Serverless::Application
    Properties:
      Location:
        ApplicationId: arn:aws:serverlessrepo:eu-west-1:057560766410:applications/aws-lambda-powertools-python-layer-extras
        SemanticVersion: 1.10.3

Environment

Deployed via

sam build --use-container && sam deploy  --capabilities CAPABILITY_IAM CAPABILITY_AUTO_EXPAND 

I've downloaded the layer to my machine and I double-checked that pydantic is not included.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions