Protobuf基础之Windows下安装python protobuf 模块

1、从https://github.com/google/protobuf 的Downloads模块下载 

protobuf-2.6.1.zip 和 protoc-2.6.1-win32.zip

(笔者机器上已安装了python2.6.4版本)

2、解压上面两个zip文件,将protoc-2.6.1-win32.zip里的protoc.exe,放到protobuf-2.6.1的src目录下

 

 

 3、cmd窗口下切换到protobuf-2.6.1的python目录下,依次运行以下命令:

python setup.py build

python setup.py test

python setup.py install


 

4、最后验证python的protobuf模块是否安装成功,运行命令:import google.protobuff,没有报错即可。



 

猜你喜欢

转载自sharley.iteye.com/blog/2375044