Skip to content

Package individually example does not work #203

@felipe-augusto

Description

@felipe-augusto

Hi, I followed the documentation on how to package individually, but it seems that is not working. Here's my serverless.yml, closely matching the example on README:

service: test

provider:
  name: aws
  runtime: python3.6
  memorySize: 128

plugins:
  - serverless-python-requirements
custom:
  pythonRequirements:
    dockerizePip: true
    zip: true

package:
  individually: true

functions:
  func1:
    handler: index.handler
    module: function1
    events:
      - http:
          path: /func1
          method: get
  func2:
    handler: index.handler
    module: function2
    events:
      - http:
          path: /func2
          method: get

And here's my folder structure:

├── function1
│   ├── index.py
│   └── requirements.txt
├── function2
│   ├── index.py
│   └── requirements.txt
├── package.json
├── serverless.yaml
└── yarn.lock

When I make a request to the func1 or func2 I get an internal server error with the following logs on both functions:

START RequestId: 6cf2a302-702d-11e8-abcd-2f24ab6d943e Version: $LATEST
Unable to import module 'index': No module named 'index'

END RequestId: 6cf2a302-702d-11e8-abcd-2f24ab6d943e

I wonder what I'm doing wrong. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions