阅读量:0
异常记录-24
异常
ImportError: /usr/local/python/lib/python3.11/site-packages/confluent_kafka/cimpl.cpython-311-x86_64-linux-gnu.so: undefined symbol: rd_kafka_event_DeleteRecords_result
描述
pip安装的confluent_kafka使用时提示异常
问题原因
librdkafka问题
解决方案
首先安装confluent_kafka需要librdkafka
yum remove librdkafka librdkafka-devel # 先删除原有的模块 # 解压librdkafka 进入librdkafka ./configure make && make install # 编译安装librdkafka librdkafka和confluent_kafka版本要注意匹配 export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH # 配置环境 echo 'export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH' >> ~/.bashrc source ~/.bashrc # 刷新环境 ldd /usr/local/python/lib/python3.11/site-packages/confluent_kafka/cimpl.cpython-311-x86_64-linux-gnu.so # 检测指向路径 # librdkafka.so.1 => /usr/local/lib/librdkafka.so.1 # confluent_kafka的安装直接使用pip安装压缩源代码或者网络安装
异常重现
已复现