Python Zkpython Installation

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.