CentOS6.5下python版本的protobuf编译及安装
2016-11-03 17:40
856 查看
因为要学习faster r-cnn,在搭建环境的时,发现原本通过yum安装的protobuf没有安装python版本以及其他一系列版本版本兼容性问题,导致我必须用编译方式重新安装protobuf2.5
按照网上教程,应该执行
但在执行autogen.sh时出错了,因为google.com被墙了,我的虚拟机里无法下载gtest,于是手动下载googletest-release-1.5.0.zip,解压缩后,改名为gtest放在protobuf-2.5.0目录下
autogen.sh代码片段
googletest1.5.0下载地址:https://github.com/google/googletest/tree/release-1.5.0
执行protobuf编译
如果没有报错,说明安装正常。
参考:
http://www.cnblogs.com/chegnshi-coding/p/4457738.html
http://blog.csdn.net/wutbiao/article/details/45029779
下载源码
首先,从github上下载protobuf的源码,地址:https://github.com/google/protobuf,我选择下载2.5.0版本。编译protobuf
然后将下载的压缩包解压缩unzip protobuf-2.5.0.zip
按照网上教程,应该执行
./configure了,但是根目录下居然没有configure文件,却有一个autogen.sh,原来是因为protobuf的编译方式做了修改,要执行autogen.sh才会生成configure脚本。
但在执行autogen.sh时出错了,因为google.com被墙了,我的虚拟机里无法下载gtest,于是手动下载googletest-release-1.5.0.zip,解压缩后,改名为gtest放在protobuf-2.5.0目录下
autogen.sh代码片段
# Check that gtest is present. Usually it is already there since the # directory is set up as an SVN external. # 判断是否存在gtest目录 if test ! -e gtest; then echo "Google Test not present. Fetching gtest-1.5.0 from the web..." #如果目录不存在则尝试从google.com下载并解压缩,如果google被墙则下载失败 curl http://googletest.googlecode.com/files/gtest-1.5.0.tar.bz2 | tar jx #将解压缩后的目录改名为gtest mv gtest-1.5.0 gtest fi
googletest1.5.0下载地址:https://github.com/google/googletest/tree/release-1.5.0
#解压缩 unzip gtest-1.5.0.zip mv gtest-1.5.0 gtest
执行protobuf编译
#执行autogen.sh生成configure ./autogen.sh ./configure # -j8 多线程编译 make -j8 make check # 安装编译成功的protobuf sudo make install
安装python模块
cd python python setup.py build python setup.py test python setup.py install
验证Python模块
验证Python模块是否被正确安装如果没有报错,说明安装正常。
$ python >>> import google.protobuf.internal >>>
参考:
http://www.cnblogs.com/chegnshi-coding/p/4457738.html
http://blog.csdn.net/wutbiao/article/details/45029779
相关文章推荐
- 如何编译安装protobuf极其python版本
- Centos6.5下python2.6.6版本下安装pycurl模块
- linux/centos6.5下编译安装python2.7和python3.5.2
- Centos 编译安装高版本Python方法
- Centos6.5下安装protobuf及简单使用
- linux/centos6.5下编译安装python2.7和python3.5.2
- Linux之CentOS编译安装指定版本Python和安装iPython
- mac 安装protobuf,并编译为java,c++,python
- Centos6.5 编译安装python3.5版本,无法使用退格键方向键删除键等
- centos6.5 64位 protobuf和protobuf-c源文件编译&安装
- centos6.5下python2.6.6版本升级Python2.7.6安装过程
- CentOS5.8下编译安装3.X版本内核
- Centos6.4下安装protobuf-c问题及解决办法
- Centos6.2 安装Python2.7.x 版本
- Centos 编译安装Python 2.6.6
- windows下安装protobuf for python
- CentOS6.5下编译安装mysql5.6.19
- 分支1-CentOS6.5下 正/反向域名解析之yum安装/编译安装 的教程
- [CentOS]安装python2.75 设置为默认版本
- CentOS下编译安装MySQL5.5.x的版本需使用Cmake编译器