您的位置:首页 > 编程语言 > Go语言

google protobuf编译安装(ImportError: No module named google.protobuf.internal)

2016-08-05 14:52 721 查看
来源:http://blog.csdn.net/woainiwss/article/details/50585665

最近在编译caffe python接口,python下import caffe报这个错误

ImportError: No module named google.protobuf.internal

原因是之前一步 pip install -r requirement.txt不成功,原因是数据源拉不到东西,只得自己亲手安装了。

首先现在protobuf 

   下载protobuf-2.3.0:
 

        http://protobuf.googlecode.com/files/protobuf-2.3.0.zip
 
     上边这个地址是在别的博客找到的,caffe要求这个版本要>=2.5.0,自己手动把地址里边的版本改为2.5.0成功下载。

接下来就是安装了:

unzip
protobuf-2.5.0

cd
protobuf-2.5.0

chmod
777 configure

./configure

make
-j4

make
check -j4

make
install 

make
install 完貌似有报错,我主要用python接口这个就没管

接下来编译python接口的(不需要python接口的请跳过)

cd ./python 

python setup.py build 

python setup.py test 

python setup.py install

验证使用命令 protoc -version

这步我还没有得到结果。

可是在python 下使用 

>>import google.protobuf

没有报错,那就是能用了。

那些错误我估计是环境变量什么的问题,先不去找这个原因了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: