1、下载thrift:
- wget http://mirror.bjtu.edu.cn/apache/thrift/0.9.2/thrift-0.9.2.tar.gz
2、安装依赖:
- sudo apt-get install build-essential
- sudo apt-get install bison flex
- sudo apt-get install libboost-dev python-dev
- sudo apt-get install autoconf automake libtool pkg-config
- sudo apt-get install git
3、安装thrift:
- tar -xzvf thrift-0.9.2.tar.gz
- cd thrift-0.9.2
- sudo ./configure --prefix=/usr/local/thrift
- sudo make && sudo make install
4、安装结束:
- In [1]: import thrift
- ---------------------------------------------------------------------------
- ImportError Traceback (most recent call last)
- /host/workspace/QQWeibo/<ipython console> in <module>()
- ImportError: No module named thrift
加入之后ok
- 在.bashrc文件中加入:
- export PYTHONPATH=/usr/lib/python2.7/site-packages