【环境安装】python操作zookeeper.md

【环境安装】python操作zookeeper.md

  1. 环境
    名称 版本
    centos 7
    python 2.7.5
    zookeeper 3.4.10
  2. 安装步骤
    首先,安装要依赖的zookeeper的c的客户端。
    cd path/zookeeper/src/c
    ./configure
    如果有以下报错信息:
    (py2) [root@master c]# ./configure
    checking for doxygen… no
    checking for perl… /usr/bin/perl
    checking for dot… no
    checking for a BSD-compatible install… /usr/bin/install -c
    checking whether build environment is sane… yes
    checking for gawk… gawk
    checking whether make sets $(MAKE)… yes
    checking for cppunit-config… no
    checking for Cppunit - version >= 1.10.2… no
    checking for generated/zookeeper.jute.c… yes
    checking for generated/zookeeper.jute.h… yes
    checking for gcc… no
    checking for cc… no
    checking for cc… no
    checking for cl… no
    configure: error: no acceptable C compiler found in $PATH
    See `config.log’ for more details.
    执行以下命令:
    yum -y install gcc*
    ./configure
    make
    make install
    安装zkpython,通过pip和源码方式安装
    pip安装:
    pip install zkpython
    源码安装: 首先进入到:https://pypi.org/search/?q=zkpython 下载源码
    解压之后进入目录执行以下命令
    python steup.py install
    添加环境变量:
    export LD_LIBRARY_PATH=/usr/local/lib
    如果不添加环境变量,在import zookeeper包的时候会报错:

import zookeeper
Traceback (most recent call last):
File “”, line 1, in
ImportError: libzookeeper_mt.so.2: cannot open shared object file: No such file or directory

参考资料
https://www.jianshu.com/p/11199dd5487e

https://www.cnblogs.com/fusx/p/10599448.html

https://www.cnblogs.com/mangoVic/p/6428369.html

https://blog.csdn.net/qq_34485930/article/details/80934025

https://blog.csdn.net/hongweigg/article/details/72957213

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值