1、下载thrift:
wget http://mirror.bjtu.edu.cn/apache//thrift/0.8.0/thrift-0.8.0.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.8.0.tar.gz cd thrift-0.8.0sudo ./configure --prefix=/host/java/thriftsudo 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
查看thrift模块是否处于sys.path中
In [7]: sys.path.append('/usr/lib/python2.7/site-packages') In [8]: import thrift
加入之后ok
在.bashrc文件中加入: export PYTHONPATH=/usr/lib/python2.7/site-packages
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有