如何使用无服务器将依赖项部署到Lambda

时间:2019-09-10 21:23:21

标签: aws-lambda

我将依赖项包含在lambda中,但仍然出现此错误:

这就是我所做的: 1.我跑了:pip3 install hvac --target sources/segment/hvac 2.在我的serverless.yml文件中:

package:
  include:
    - hvac/**
    - psycopg2/**

3。我跑了sls deploy 4.我看到了文件夹:

enter image description here

但是当我在aws上运行lambda时,我得到:

Response:
{
  "errorMessage": "Unable to import module 'handler': cannot import name 'Client' from 'hvac' (unknown location)",
  "errorType": "Runtime.ImportModuleError"
}

0 个答案:

没有答案