错误安装Confluent Kafka -LD:未找到-lrdkafka的库
我正在尝试在Mac OS上安装Confluent Kafka Python模块。 我的python版本是3.9 我一直在低于错误。
有人知道如何解决这个问题吗?
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c /private/var/folders/tm/l00fw55n55vgglqsy56lhgbh0000gn/T/pip-install-eocpb3xa/confluent-kafka_f77dbcfd032f447791927683e1f5f56b/src/confluent_kafka/src/confluent_kafka.c -o build/temp.macosx-12-arm64-cpython-39/private/var/folders/tm/l00fw55n55vgglqsy56lhgbh0000gn/T/pip-install-eocpb3xa/confluent-kafka_f77dbcfd032f447791927683e1f5f56b/src/confluent_kafka/src/confluent_kafka.o
/private/var/folders/tm/l00fw55n55vgglqsy56lhgbh0000gn/T/pip-install-eocpb3xa/confluent-kafka_f77dbcfd032f447791927683e1f5f56b/src/confluent_kafka/src/confluent_kafka.c:2545:9: warning: 'PyEval_InitThreads' is deprecated [-Wdeprecated-declarations]
PyEval_InitThreads();
^
/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9/ceval.h:130:1: note: 'PyEval_InitThreads' has been explicitly marked deprecated here
Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
^
/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
^
1 warning generated.
clang -bundle -undefined dynamic_lookup build/temp.macosx-12-arm64-cpython-39/private/var/folders/tm/l00fw55n55vgglqsy56lhgbh0000gn/T/pip-install-eocpb3xa/confluent-kafka_f77dbcfd032f447791927683e1f5f56b/src/confluent_kafka/src/Admin.o build/temp.macosx-12-arm64-cpython-39/private/var/folders/tm/l00fw55n55vgglqsy56lhgbh0000gn/T/pip-install-eocpb3xa/confluent-kafka_f77dbcfd032f447791927683e1f5f56b/src/confluent_kafka/src/AdminTypes.o build/temp.macosx-12-arm64-cpython-39/private/var/folders/tm/l00fw55n55vgglqsy56lhgbh0000gn/T/pip-install-eocpb3xa/confluent-kafka_f77dbcfd032f447791927683e1f5f56b/src/confluent_kafka/src/Consumer.o build/temp.macosx-12-arm64-cpython-39/private/var/folders/tm/l00fw55n55vgglqsy56lhgbh0000gn/T/pip-install-eocpb3xa/confluent-kafka_f77dbcfd032f447791927683e1f5f56b/src/confluent_kafka/src/Metadata.o build/temp.macosx-12-arm64-cpython-39/private/var/folders/tm/l00fw55n55vgglqsy56lhgbh0000gn/T/pip-install-eocpb3xa/confluent-kafka_f77dbcfd032f447791927683e1f5f56b/src/confluent_kafka/src/Producer.o build/temp.macosx-12-arm64-cpython-39/private/var/folders/tm/l00fw55n55vgglqsy56lhgbh0000gn/T/pip-install-eocpb3xa/confluent-kafka_f77dbcfd032f447791927683e1f5f56b/src/confluent_kafka/src/confluent_kafka.o -lrdkafka -o build/lib.macosx-12-arm64-cpython-39/confluent_kafka/cimpl.cpython-39-darwin.so
ld: library not found for -lrdkafka
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> confluent-kafka
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
WARNING: There was an error checking the latest version of pip.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您似乎正在使用M1 Mac。
这是Aarch64/ARM64库的一个空缺问题,
同时,您也许可以使用
kafka-python
或aiokafka
,因为它们不依赖于librdkafka
。You appear to be using an M1 Mac.
This is an open issue for aarch64 / arm64 libraries https://github.com/confluentinc/confluent-kafka-python/issues/1190
In the meantime, you might be able to use
kafka-python
oraiokafka
since they don't depend onlibrdkafka
.