Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lambda function failing with /lib64/libc.so.6: version `GLIBC_2.18' not found

I am trying to create a layer of simple-salesforce (Python Library) in AWS lambda, and trying to use it (import it) from my python code. I am having windows machine.

Though I read that there might be issues due to compilation windows so I install ubuntu1804 from windows store and then went ahead with creating zip for lambda layers. (zip is created for python folder with structure "python/lib/python3.6/site-packages/......")

I am using Python 3.6. I went through few articles for this issue but could find any resolution. this Video helped me creating a layer for Pandas & requests in AWS successfully with minor tweaks in pip commands I used

sudo python3 -m pip install simple-salesforce -t build/python/lib/python3.6/site-packages

Exactly same process i used for Simple salesforce and I am getting below error is as below:

Unable to import module 'lambda_function': /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /opt/python/lib/python3.6/site-packages/cryptography/hazmat/bindings/_rust.abi3.so)

Edit: -- Another approach I tried using .whl though this was not giving above error but giving error as "request module not found" and when I add request module layer it gives error authlib not found. (request layers work fine if I comment salesforce related things. Even tried uploading as simple layer same authlib issue I got)

Edit : Lambda code I am using is as below

the code I am using is basic code which doesnt have any logic with empty imports

import json
import pandas as pd
import requests as req
from simple_salesforce.format import format_soql

def lambda_handler(event, context):
    #TODO
like image 251
Tanmay Bordekar Avatar asked Jul 17 '26 07:07

Tanmay Bordekar


1 Answers

I also received the same error while installing pysftp on lambda which uses cryptography library(python) the error was similiar to (required by /opt/python/lib/python3.6/site-packages/cryptography/hazmat/bindings/_rust.abi3.so)

The solution that worked for me is 1] pip uninstall cryptography 2] pip install cryptography==3.4.8 The following github link explains it in detail https://github.com/pyca/cryptography/issues/6390

like image 101
Pavan Agarwal Avatar answered Jul 28 '26 09:07

Pavan Agarwal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!