1. Because the Python client relies on the C client, install the C version of the client first
CD zookeeper-3.4.5/src/c
./configure
Make
Make install
2. Download the Python extension package and unzip it:
Address: https://pypi.python.org/pypi/zkpython/0.4.2
3. If Pyhon.h cannot be found, there may be no python26-devel installed
32-Bit direct operation
Yum Install python26-devel.i386
Python setup.py Install
4. Whether the test was successful
Import Zookeeper
If error:
>>> Import Zookeeper
Traceback (most recent):
File "<stdin>", line 1, in <module>
Importerror:libzookeeper_mt.so.2:cannot open Shared object file:no such file or directory
Configure in the shell or if the/etc/profile file:
Export ld_library_path=/usr/local/lib/
5. Use
>>> Import Zookeeper
>>> hander = Zookeeper.init ("dc002.tj:2181")
>>> dir (zookeeper) #方法列表
Python Zkpython Installation