Serverless-python-layers: No file matches include / exclude patterns

I am trying some skeleton deployment using python. Here is my serverless.yaml

My folder structure is

serverless-test
|_lambdas
|____handler.py
|_layers
|____common
|_________somefunction.py
service: serverless-test

frameworkVersion: '2'

provider:
  name: aws
  runtime: python3.8
  lambdaHashingVersion: 20201221

  stage: test
  region: us-west-2

functions:
  hello:
    handler: lambdas/handler.hello

This works fine. Now as soon as I add a layer, I get the following error

No file matches include / exclude patterns

service: serverless-test

frameworkVersion: '2'

provider:
  name: aws
  runtime: python3.8
  lambdaHashingVersion: 20201221

  stage: test
  region: us-west-2

functions:
  hello:
    handler: lambdas/handler.hello
    layers:
      - {Ref: CommonLambdaLayer}

layers:
  common:
    path: layers/common
    name: common-module
    description: common set of functions

I also tried adding include and exclude patterns. But it didn’t solve my problem

service: serverless-test

frameworkVersion: '2'

provider:
  name: aws
  runtime: python3.8
  lambdaHashingVersion: 20201221

  stage: test
  region: us-west-2

package:
  individually: true
  exclude: 
    - ./**
  include:
    - ./lambdas/**

functions:
  hello:
    handler: lambdas/handler.hello
    layers:
      - {Ref: CommonLambdaLayer}

layers:
  common:
    path: layers/common
    name: common-module
    description: common set of functions
    package:
      include:
        - ./**

I also tried being very specific

service: serverless-test

frameworkVersion: '2'

provider:
  name: aws
  runtime: python3.8
  lambdaHashingVersion: 20201221

  stage: test
  region: us-west-2

package:
  individually: true
  exclude: 
    - ./**

functions:
  hello:
    handler: lambdas/handler.hello
    layers:
      - {Ref: CommonLambdaLayer}
    package:
      exclude:
        - ./**
      include:
        - ./lambdas/handler.py

layers:
  common:
    path: layers/common
    name: common-module
    description: common set of functions
    package:
      exclude:
        - ./**
      include:
        - ./layers/common/somefunction.py

Your dependencies should be packaged properly. you should put the dependencies in a folder named python. See image reference below

here’s a yml example for nodejs
layers:
common:
path: ./
name: my-layer
retain: true
package:
exclude:
- "/*"
include:
- nodejs/

try this for python
layers:
common:
path: ./
name: my-layer
retain: true
package:
exclude:
- "/*"
include:
- python/


You don’t need to zip btw, just follow the file structure. More info here

Nope this is not necessary if we are doing with serverless. When we add it as layers serverless handles it internally.

Since my project was a POC, I switched from python to nodeJs keeping the folder structure same, the issue is resolved without even making a single change.

This problem persists only for python layers