1

I am using Macbook with M series chip.

While running python which has confluent-kafka dependency, getting this error.

Installed dependencies using pip3. Also installed librdkafka

ImportError: dlopen(/Library/Python/3.8/site-packages/confluent_kafka/cimpl.cpython-38-darwin.so, 0x0002): tried: '/Library/Python/3.8/site-packages/confluent_kafka/cimpl.cpython-38-darwin.so' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64)))

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
wenky
  • 471
  • 1
  • 6
  • 14
  • 1
    How did you install `librdkafka`? The error is unusual, because it says it's looking for an x86_64 binary. There are similar reports on their git repository. https://github.com/confluentinc/confluent-kafka-python/issues/1190#issuecomment-1017410984 – Tim Roberts Aug 25 '22 at 18:32
  • There it is about installation issues.., I am able to install the package. After installation while running I am facing this. I have installed librdkafka using ```brew install librdkafka``` . It didn't throw any issues while I am installing. – wenky Aug 26 '22 at 06:07

1 Answers1

1

Always check github issues.

https://github.com/confluentinc/confluent-kafka-python/issues/1190#issuecomment-1017410984

If you used homebrew to get librdkafka, you can install like so

C_INCLUDE_PATH=/opt/homebrew/Cellar/librdkafka/1.8.2/include LIBRARY_PATH=/opt/homebrew/Cellar/librdkafka/1.8.2/lib pip install confluent_kafka

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245