confluentinc / confluent-kafka-python

Confluent's Kafka Python Client
http://docs.confluent.io/current/clients/confluent-kafka-python
Other
108 stars 894 forks source link

AttributeError: module 'os' has no attribute 'add_dll_directory' - Python 3.9 - Lambda Function in AWS #1528

Open ANJALI2980 opened 1 year ago

ANJALI2980 commented 1 year ago

Description

I have created a layer with confluent_kafka-2.0.2 in lambda function. when I simply run it, I get error at import statement.

confluentkafka

Code : codesnippet

Attached Zip file used for creating layer : confluentkafka.zip

How to reproduce

Checklist

Please provide the following information:

pranavrth commented 1 year ago

The issue seems similar to https://github.com/confluentinc/confluent-kafka-python/issues/1462. Please check.

ANJALI2980 commented 1 year ago

1462 was resolved by switching to Linux.

I need to get it resolved in windows

shot87 commented 1 year ago

1462 was resolved by switching to Linux. I need to get it resolved in windows

can you describe the fix in more details?

ANJALI2980 commented 1 year ago

1462 got resolved when the operating system was switched to Linux.

arryan231 commented 11 months ago

were you able to fix this issue

the-real-henry commented 11 months ago

Experienced the same issue; using windows os environment in development, AWS Lambda (AWS Linux) python 3.11 runtime in production.

The error is resolved by creating package within linux/unix environment using virualization. add_dll_directory applies to windows os. runtime and is not compatible when running on linux. For more read #1462

nhaq-confluent commented 8 months ago

@ANJALI2980 is this issue still needing to be resolved or were you able to find a solution?

phanicode commented 2 months ago

Does anyone in this thread have a compatible lambda-function layer for AWS Lambda with any version between python3.9-3.11?. There are lots of questions with outdated answers on this.