[Django]-Pip install confluent-kafka gives error in mac

8👍

Install the librdkafka library

brew install librdkafka

Set the environment variables

export C_INCLUDE_PATH=/usr/local/Cellar/librdkafka/2.2.0/include
export LIBRARY_PATH=/usr/local/Cellar/librdkafka/2.2.0/lib

Then you can install it through pip install

👤omotto

4👍

Omotto’s answer solves the issue.

Just a note, replace the version 1.8.2 with the version you have. You can check the version by going to this path /opt/homebrew/Cellar/librdkafka(Since Homebrew is installed here if it’s an M1 Mac). The name of the folder inside will give you the version number.

Leave a comment