Issue: When Installing confluent-kafka python library, It has a dependency on librdkafka (a c/c++ library for kafka) and this librdkafka library is not installed by default in ARM architecture.
when we try to install the confluent-kafka without installing the librdkafka, this happens.
pip install confluent-kafka==1.13.0
Error:
confluent_kafka/src/confluent_kafka.h:22:32: fatal error: librdkafka/rdkafka.h: No such file or directory #include <librdkafka/rdkafka.h> ^ compilation terminated. error: command ‘gcc’ failed with exit status 1
Detail Error log:
Let’s Fix this: To fix this we need to install librdkafka library manually from source. Download the desired from librdkafka-github repo. [Note: install a version ≥1.6.0 as ARM is not supported in prior version]
Go to librdkafka’s release page and download the tar.gz file.
https://github.com/edenhill/librdkafka/releases/tag/v1.7.0
unzip the file
tar xzvf v1.7.0.tar.gz
A new folder will be there with name librdkafka-1.7.0
cd librdkafka-1.7.0
Now follow the process defined on their github repo. This include below steps:
- ./configure — will generate a configuration summary on output
- make
- sudo make install
output of above install:
Now let’s install our confluent-kafka library
pip install confluent-kafka==1.3.0
and It will be install successfully.
If any error occurred. Put a comment and let me know.