1

I want to connect to MS SQL Server using pyodbc on AWS Lambda. When i deploy the package, i get an error:

No module named "pyodbc".

I have added the following files in the Lambda package:

  • pyodbc.cp36-win32
  • pyodbc-4.0.16.dist-info
  • dbaccess.py

dbaccess.py contains the working code with pyodbc.

What am I missing to deploy pyodbc on AWS Lambda so I can connect to SQL Server?

FlipperPA
  • 13,607
  • 4
  • 39
  • 71

1 Answers1

0

Amazon provides a guide on how to build packages for deployment here: https://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html

The being said, you can short-cut the process for pyodbc for Lambda here: https://github.com/Miserlou/lambda-packages/tree/master/lambda_packages/pyodbc

Mark Morgan
  • 1
  • 1
  • 3