2

I am trying to deploy an app created with the serverless framework. However, due to adding some packages that I need, the whole thing breaks.

This is my requirements.txt

dlib==19.21.1
numpy==1.18.0
opencv-python==4.4.0.42
PyJWT==2.0.0
SQLAlchemy==1.3.22

This is my serverless.yml

custom:
  pythonRequirements:
    dockerFile: ./Dockerfile
    dockerizePip: true
    slim: true
    useDownloadCache: true
    useStaticCache: true

provider:
  name: aws
  runtime: python3.7
  stage: dev
  region: us-west-2
  timeout: 29
  httpApi:
    cors: true

functions:
  selfieCapture:
    handler: services/widget/transaction/selfie/handler.main
    events:
      - httpApi:
          path: /v1/widget/transaction/selfie
          method: POST

I am working on a windows environment. The package that breaks everything is the dlib. After following some tutorial I was able to install dlib on my local, however, whenever I run the serverless deploy, the python packages are left on my project folder and this error pops up:

Error: ENOTDIR: not a directory, scandir 'C:\Users\Manhu\PROJECTS\services-python\_dlib_pybind11.cpython-37m-x86_64-linux-gnu.so'

Before trying with docker, I tried with my own python installation by adding the pythonBin, removing Dockerfile option and DockerizePip, however, nothing works. If I leave my requirements.txt with just PyJWT and SQLAlchemy, the deploy works (with local python or with docker). I also added the "SLS_DEBUG" env variable but no additional or relevant information shows up What should I do?

Wrathful Dudu
  • 73
  • 1
  • 5

0 Answers0