简体   繁体   中英

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

I am using Macbook with M series chip.

While running python which has confluent-kafka dependency, getting this error.

Installed dependencies using pip3. Also installed 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)))

Always check github issues.

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

If you used homebrew to get librdkafka, you can install like so

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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