发布时间:2019-09-22 07:39:35编辑:auto阅读(2154)
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.0
- sudo ./configure --prefix=/host/java/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
查看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
上一篇: python36安装
下一篇: Python编写规则值得收藏
50173
49447
40093
37125
31532
28367
27321
22113
22076
20411
69°
658°
480°
467°
685°
606°
1204°
2272°
2098°
1634°