花了太多时间尝试安装 confluent-kafka,但没有成功。我知道有一个 librdkafka 依赖项,但似乎已成功安装。
尝试以下建议:
http://docs.confluent.io/3.1.1/installation.html#cpp-client
https://github.com/confluentinc/confluent-kafka-python/issues/6
https://github.com/confluentinc/confluent-kafka-go/issues/39
结果
MyMac1234567:~ joe.user$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.12.3
BuildVersion: 16D32
MyMac1234567:~ joe.user$ brew install openssl
Updating Homebrew...
==> Auto-updated Homebrew!
Updated Homebrew from bb3e509 to 7e5b2fb.
Updated 1 tap (homebrew/core).
==> Updated Formulae
kafka
Warning: openssl is a keg-only and another version is linked to opt.
Use `brew install --force` if you want to install this version
MyMac1234567:~ joe.user$ brew install librdkafka
==> Using the sandbox
==> Downloading https://github.com/edenhill/librdkafka/archive/0.9.1.tar.gz
Already downloaded: /Users/jeff.graham/Library/Caches/Homebrew/librdkafka-0.9.1.tar.gz
==> ./configure --prefix=/usr/local/Cellar/librdkafka/0.9.1
==> make
==> make install
/usr/local/Cellar/librdkafka/0.9.1: 14 files, 1.3MB, built in 11 seconds
MyMac1234567:~ joe.user$ python -V
Python 2.7.10
MyMac1234567:~ joe.user$ pip -V
pip 9.0.1 from /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg (python 2.7)
MyMac1234567:~ joe.user$ sudo -H pip install confluent-kafka
Collecting confluent-kafka
Using cached confluent-kafka-0.9.4.tar.gz
Installing collected packages: confluent-kafka
Running setup.py install for confluent-kafka ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-VbLtMr/confluent-kafka/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-iPYPmz-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.12-intel-2.7
creating build/lib.macosx-10.12-intel-2.7/confluent_kafka
copying confluent_kafka/__init__.py -> build/lib.macosx-10.12-intel-2.7/confluent_kafka
creating build/lib.macosx-10.12-intel-2.7/confluent_kafka/avro
copying confluent_kafka/avro/__init__.py -> build/lib.macosx-10.12-intel-2.7/confluent_kafka/avro
copying confluent_kafka/avro/cached_schema_registry_client.py -> build/lib.macosx-10.12-intel-2.7/confluent_kafka/avro
creating build/lib.macosx-10.12-intel-2.7/confluent_kafka/kafkatest
copying confluent_kafka/kafkatest/__init__.py -> build/lib.macosx-10.12-intel-2.7/confluent_kafka/kafkatest
copying confluent_kafka/kafkatest/verifiable_client.py -> build/lib.macosx-10.12-intel-2.7/confluent_kafka/kafkatest
copying confluent_kafka/kafkatest/verifiable_consumer.py -> build/lib.macosx-10.12-intel-2.7/confluent_kafka/kafkatest
copying confluent_kafka/kafkatest/verifiable_producer.py -> build/lib.macosx-10.12-intel-2.7/confluent_kafka/kafkatest
creating build/lib.macosx-10.12-intel-2.7/confluent_kafka/avro/serializer
copying confluent_kafka/avro/serializer/__init__.py -> build/lib.macosx-10.12-intel-2.7/confluent_kafka/avro/serializer
copying confluent_kafka/avro/serializer/message_serializer.py -> build/lib.macosx-10.12-intel-2.7/confluent_kafka/avro/serializer
running build_ext
building 'confluent_kafka.cimpl' extension
creating build/temp.macosx-10.12-intel-2.7
creating build/temp.macosx-10.12-intel-2.7/confluent_kafka
creating build/temp.macosx-10.12-intel-2.7/confluent_kafka/src
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c confluent_kafka/src/confluent_kafka.c -o build/temp.macosx-10.12-intel-2.7/confluent_kafka/src/confluent_kafka.o
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c confluent_kafka/src/Producer.c -o build/temp.macosx-10.12-intel-2.7/confluent_kafka/src/Producer.o
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c confluent_kafka/src/Consumer.c -o build/temp.macosx-10.12-intel-2.7/confluent_kafka/src/Consumer.o
cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.12-intel-2.7/confluent_kafka/src/confluent_kafka.o build/temp.macosx-10.12-intel-2.7/confluent_kafka/src/Producer.o build/temp.macosx-10.12-intel-2.7/confluent_kafka/src/Consumer.o -lrdkafka -o build/lib.macosx-10.12-intel-2.7/confluent_kafka/cimpl.so
ld: warning: ignoring file /usr/local/lib/librdkafka.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/librdkafka.dylib
running install_lib
copying build/lib.macosx-10.12-intel-2.7/confluent_kafka/cimpl.so -> /Library/Python/2.7/site-packages/confluent_kafka
running install_data
copying LICENSE -> /System/Library/Frameworks/Python.framework/Versions/2.7/
error: [Errno 1] Operation not permitted: '/System/Library/Frameworks/Python.framework/Versions/2.7/LICENSE'
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-VbLtMr/confluent-kafka/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-iPYPmz-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-VbLtMr/confluent-kafka/