[PLEASE DELETE AS MOVED TO STACKOVERFLOW] Issue with installing own python package with docker during serverless deployment


This is my first post in this forum, so I hope I’m following all the required rules.
I want to deploy my python package to Amazon and make it available via lambda. For this I’m trying serverless.

When I try to deploy my package I get the following error message:

$ serverless deploy --stage dev --aws-profile default
Serverless: Generated requirements from lambda/tagdoc/requirements.txt in lambda/tagdoc/.serverless/requirements.txt...
Serverless: Installing requirements from lambda/tagdoc/.serverless/requirements/requirements.txt ...
Serverless: Docker Image: lambci/lambda:build-python3.6
  Error --------------------------------------------------
  Requirement 'pkgg-0.1.0.tar.gz' looks like a filename, but the file does not exist
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/var/task/pkgg-0.1.0.tar.gz'

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
  Your Environment Information -----------------------------
     OS:                     linux
     Node Version:           8.12.0
     Serverless Version:     1.32.0

my serverless.yml file looks like this:

# Welcome to Serverless!
# This file is the main config file for your service.
# It's very minimal at this point and uses default values.
# You can always add more config options for more control.
# We've included some commented out config examples here.
# Just uncomment any of them to get that config option.
# For full config options, check the docs:
#    docs.serverless.com
# Happy Coding!

service: tagdoc # NOTE: update this with your service name

# You can pin your service to only deploy with a specific Serverless version
# Check out our docs for more details
# frameworkVersion: "=X.X.X"

  name: aws
  runtime: python3.6
  region: eu-central-1
# you can overwrite defaults here
#  stage: dev

  - serverless-python-requirements

# You need to have Docker installed to be able to set dockerizePip:
# true or dockerizePip: non-linux. Alternatively, you can set
# dockerizePip: false, and it will not use Docker packaging. But,
# Docker packaging is essential if you need to build native packages
# that are part of your dependencies like Psycopg2, NumPy, Pandas, etc
    dockerizePip: true
# you can define service wide environment variables here
#  environment:
#    variable1: value1

# you can add packaging information here
    - ./nltk_data/*

    handler: handler.ttxt
      - http:
          path: /ttxt
          method: get
          integration: lambda
              application/json: '{ "txt" : "$input.params(''txt'')" }'
    handler: handler.turl
      - http:
          path: /turl
          method: get
          integration: lambda
              application/json: '{ "url" : "$input.params(''url'')" }'
              Content-Type: "'application/json'"

and of top the directory includes all the required files, in particular the built python package:

tree -L 2 lambda/
└── tagdoc
    ├── pkgg-0.1.0.tar.gz
    ├── handler.py
    ├── nltk_data
    ├── node_modules
    ├── package.json
    ├── package-lock.json
    ├── README.md
    ├── requirements.txt
    ├── serverless.yml
    └── srv

4 directories, 8 files

I’m currently running Debian 9.5. I’ve also shared the code with a friend running the same OS via Github and it seems he can deploy the package. Therefore, it looks it has to do with my local setup of serverless / docker. But I can’t figure out how to resolve this. Any help would be really appreciated.