admin管理员组

文章数量:1289832

I have created a lambda layer for the requests package and testes - I have successfully gotten this to work for requests, but cannot get the pyodbc package to work.

I have tried to create a package for pyodbc using the exact same method:

  1. new directory
  2. create venv
  3. install venv
  4. copy lib dir from venv to new folder called "python"
  5. ensure the path matches .html i.e. python/lib/python3.10/site-packages
  6. zipped python to python.zip
  7. uploaded python.zip as lambda layer
  8. attached pyodbc lambda layer to lambda function

I am still getting the error

Response:
{
  "errorMessage": "Unable to import module 'lambda_function': No module named 'pyodbc'",
  "errorType": "Runtime.ImportModuleError",
  "requestId": "",
  "stackTrace": [] 
}

At this point in my test with requests I was now getting a successful response.

What am I missing?

本文标签: pythonhow to get pyodbc running in lambda layerStack Overflow