繁体   English   中英

导入错误 confluent_kafka mach-o 文件,但是是不兼容的架构(有(arm64),需要(x86_64)))

[英]import error confluent_kafka mach-o file, but is an incompatible architecture (have (arm64), need (x86_64)))

我正在使用带有 M 系列芯片的 Macbook。

在运行具有 confluent-kafka 依赖项的 python 时,出现此错误。

使用 pip3 安装依赖项。 还安装了 librdkafka

ImportError: dlopen(/Library/Python/3.8/site-packages/confluent_kafka/cimpl.cpython-38-darwin.so, 0x0002): tried: '/Library/Python/3.8/site-packages/confluent_kafka/cimpl.cpython-38-darwin.so' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64)))

始终检查 github 问题。

https://github.com/confluentinc/confluent-kafka-python/issues/1190#issuecomment-1017410984

如果你使用 homebrew 来获取 librdkafka,你可以像这样安装

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM