Now I will describe how to install pydoop (version 0.9.1) and happybase (0.6) on python3.x
What is pydoop ? >> pydoop is python api for MapReduce and HDFS. you can googling for more details.
What is happybase ? >> happybase is python api for hbase. as same above, googling for more details.
Why cannot install pydoop and happybase directly to python3? >> For reason is both api are implemented on python 2.x cannot install directly to python3
ok we will know about problem. Start to install.
- Install Hadoop, You can see this article.
- Install libboost. (get install by $ sudo aptitude install libboost-python-dev)
- Create python virtual environment. You can see this article (Thai Language)
- Set Environment path by add these line to end of .bashrc file. ($ vim .bashrc)
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export HADOOP_HOME="/usr/local/hadoop"
export HADOOP_VERSION=1.0.4
- Reset Shell or $ source .bashrc
- Active your virtual environment
$ source [your virtual environment]/bin/active
-Install pydoop
$ pip install pydoop
If you get error "SyntaxError: invalid syntax" don't worry conern it. You must convert all 2.x python code to 3.x python code.
Run the script to convert all .py files (2.x python code) to 3.x python code. (Put the script in pydoop directory, pydoop should be in /tmp/pip-build-xxx-xxxx/pydoop)
After run the script finish type pip again.
$ pip install pydoop
pydoop installation successful.
-Install happybase
$ pip install happybase
You will get error same as pydoop installation. You can convert all .py 2 to 3 same as pydoop.
There are 2 path to convert /tmp/pip-build-xxx-xxxx/happybase and /tmp/pip-build-xxx-xxxx/thrift
If you convert every .py in 2 above directory. you will get successful.
ภาษาฝรั่งกันเลยทีเดียว
ตอบลบ