confluent-kafka in AWS Python Lambda. Unable to import module 'main': No module named 'confluent_kafka.cimpl

176 Views Asked by At

I am trying to attach confluent_kafka as a layer to a Python3.9 lambda function and am getting this error.

Unable to import module 'main': No module named 'confluent_kafka.cimpl

I have other layers on the same function for requests and neo4j which are working fine, but confluent is not.

To install the layer, I have use pip3 install -t python confluent-kafka. Python is an empty folder. I then zip the python folder up and deploy the layer. I am using terraform to deploy.

I have followed this answer and ensured there are no sub directories under the parent. enter image description here

They layer is attached enter image description here

My import line for confluent_kafka: enter image description here

How can I resolve this issue and import the package?

0

There are 0 best solutions below