发布时间:2019-09-22 07:39:35编辑:auto阅读(1739)
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编写规则值得收藏
47837
46379
37264
34722
29306
25964
24893
19943
19534
18014
5785°
6406°
5921°
5957°
7060°
5904°
5936°
6432°
6400°
7772°