pip install confluent-kafka报错
详细报错信息如下:command ‘/usr/bin/clang’ failed with exit code 1
解决方法:In file included from /private/var/folders/1j/_2k0y4gx0d99ztgscclcdtm00000gn/T/pip-install-pvl5wiht/confluent-kafka_e40a9bb26f4944f4a4cd23aad3a5cb2d/src/confluent_kafka/src/Admin.c:17:
/private/var/folders/1j/_2k0y4gx0d99ztgscclcdtm00000gn/T/pip-install-pvl5wiht/confluent-kafka_e40a9bb26f4944f4a4cd23aad3a5cb2d/src/confluent_kafka/src/confluent_kafka.h:23:10: fatal error: ‘librdkafka/rdkafka.h’ file not found
#include
^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command ‘/usr/bin/clang’ failed with exit code 1
1.先在本地安装librdkafka
brew install librdkafka@1.8.2
2.再指定librdkafka的头文件路径使得pip能顺利安装
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
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)