Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip install confluent-kafka gives error in mac

When i tried pip install confluent-kafka got the following error


#include <librdkafka/rdkafka.h>
             ^~~~~~~~~~~~~~~~~~~~~~
    1 error generated.
    error: command '/usr/bin/gcc' failed with exit code 1

I'm using python version 3.9 and macOs Monterey

like image 708
Muhammed Fayis Avatar asked Oct 19 '25 12:10

Muhammed Fayis


1 Answers

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

like image 159
omotto Avatar answered Oct 21 '25 02:10

omotto