serverless-python-requirements icon indicating copy to clipboard operation
serverless-python-requirements copied to clipboard

Installing Pyodbc & Turbodbc in a layer

Open alexanderluiscampino opened this issue 5 years ago • 5 comments

Has anyone had success in using this plugin to install libraries that depend on C compiled libraries to run?

Would be awesome if we could get it working since this is such a major use of lambdas, loading data to SQL Server databses.

Thank you

alexanderluiscampino avatar Feb 17 '20 18:02 alexanderluiscampino

#Triage label: question

@alexanderluiscampino Indeed - one of the use cases I've had was to install C-compiled packages.

I've found that in order for the compilation step to work in AWS Lambda, I have to use the dockerizePip configuration, so the compiled library will conform to the target execution environment. Have you read https://github.com/UnitedIncome/serverless-python-requirements#cross-compiling and tried this approach?

miketheman avatar Feb 18 '20 00:02 miketheman

Hi @miketheman , thank you for the answer. - Indeed, cross compiling by creating my own docker image is what I have been trying to do for a while. But can never isolate all the c compiled libs I need to make Pyodbc and Turbodbc work.

I was wondering if anyone has made this work in a clean repeatable way. If not, Ill keep trying until something works then for sure will post here

alexanderluiscampino avatar Feb 18 '20 05:02 alexanderluiscampino

@alexanderluiscampino were you able to make this work? I have the same problem.

ianpogi5 avatar Aug 04 '20 00:08 ianpogi5

@ianpogi5 , never managed to have this working, just use pyodbc for all my sql server related operations

alexanderluiscampino avatar Aug 04 '20 04:08 alexanderluiscampino

If anyone is interested I've created a lambda layer for turbodbc, available at https://github.com/rickythefox/turbodbc-lambda-layer .

rickythefox avatar Apr 20 '23 12:04 rickythefox