MacbookPro M1安装confluent-kafka

MacbookPro M1安装confluent-kafka,第1张

MacbookPro M1安装confluent-kafka 问题记录:

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

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5706158.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存