标签:oca stdin imp rect 下载 most back file 版本
1.由于python客户端依赖c的客户端所以要先安装c版本的客户端
cd zookeeper-3.4.5/src/c
./configure
make
make install
2.下载python扩展包,并且解压:
地址:https://pypi.python.org/pypi/zkpython/0.4.2
3.如果找不到Pyhon.h,可能由于没有安装python26-devel
32位直接运行
yum install python26-devel.i386
python setup.py install
4.测试是否成功
import zookeeper
如果报错:
>>> import zookeeper
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: libzookeeper_mt.so.2: cannot open shared object file: No such file or directory
在shell中配置或者假如/etc/profile文件中:
export LD_LIBRARY_PATH=/usr/local/lib/
5.使用
>>> import zookeeper
>>> hander = zookeeper.init("dc002.tj:2181")
>>> dir(zookeeper) #方法列表
标签:oca stdin imp rect 下载 most back file 版本
原文地址:http://www.cnblogs.com/likui360/p/7799607.html