Python 3.9 please help, need someone to package confluent_kafka for me into zip as a Lambda layer

re-asking, hopefully this is understood better

I’m figuring out it’s most probably me working on a ARM based Mac… it’s both MACOS and ARM architecture tripping me.
Not coming right with various examples… and it’s costing me huge time.

Can someone please assist. need confluent_kafka package packaged into zip file for Lambda function based on Python 3.9
anyone willing to spare 5min and help.
G


So I now created a ubuntu host on AWS, installed Python3.9 there
then installed the confluent 2.1.1 libraries into a destination folder, ./python/lib/python3.9/site-packages
zipped that, imported as a layer and STILLL

if i uncompress my python.zip I get: lib/python3.9/site-packages
in which i then have confluent_kafka, confluent_kafka-2.1.1.dist-info, confluent_kafka.libs and the LICENSE.txt file.

advise please, Pleaseeeee help.

G

I keep ending with
{
“errorMessage”: “Unable to import module ‘lambda_function’: No module named ‘confluent_kafka’”,
“errorType”: “Runtime.ImportModuleError”,
“requestId”: “de63df94-e32a-4f51-85fd-d3cf68d7f4c7”,
“stackTrace”:
}

OR

{
“errorMessage”: “Unable to import module ‘lambda_function’: No module named ‘confluent_kafka.cipl’”,
“errorType”: “Runtime.ImportModuleError”,
“requestId”: “de63df94-e32a-4f51-85fd-d3cf68d7f4c7”,
“stackTrace”:
}

Hi guys…

Got the python import eventually to work…

Resolution was to build a EC2 instance, install python 3.9.16, create virtual env, install libraries =2.1.1 , zip libraries… upload as a layer.

Initially used a EC2 instance I had, build on Ubuntu, did not work, had to spin a new EC2 using amazon Linux (as that is what Lambda’s use). Worked.

Now to dig a hole through our firewalls to get outside onto the cluster.

If anyone needs these libraries, happy to share.

for some background, I’m working on a M1 based MAC… which just made everything/ transportability of libraries a bit more difficult.

G