ProtoBuff

 

ProtoBuff Install

download from https://github.com/google/protobuf/releases 
now version is 2.6.1

windows

image_1b321bj7eumfia6q2mffpd9.png-35.9kB

已经编译好了protoc放在protobuf-2.6.1/src目录下

然后如果要安装python环境的话, 
cd python

  1. python setup.py build
  2. python setup.py install

mac

需要自己编译protoc,不然报错提醒

  1. protoc is not installed nor found in ../src. Please compile it or install the binary package.

cd protobuf-2.6.1

  1. ./configure
  2. make
  3. make check
  4. make install

protoc –version 测试

cd python

  1. sudo python steup.pu build
  2. sudo python steup.pu install 
 
生成python文件
protoc --python_out=./ message.proto
 
 
posted @ 2018-05-25 13:33  红领巾下的大刀疤  阅读(1036)  评论(0)    收藏  举报
/* 看板娘 */