windows安装protobuf python版本
下载地址
https://github.com/protocolbuffers/protobuf/releases/tag/v3.14.0
下载两个zip包
protobuf-python-3.14.0.zip
protoc-3.14.0-win32.zip
解压zip包并复制exe文件到指定目录
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-2npZDLuD-1608270617112)(evernotecid://A7BA1EDC-F70B-4A16-ABAA-EDD379BB023D/appyinxiangcom/29884553/ENResource/p209)]
# 复制 protoc.exe 到 \protobuf-3.14.0\src
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-uiP3UgAu-1608270617115)(evernotecid://A7BA1EDC-F70B-4A16-ABAA-EDD379BB023D/appyinxiangcom/29884553/ENResource/p208)]
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-bGncvZsM-1608270617117)(evernotecid://A7BA1EDC-F70B-4A16-ABAA-EDD379BB023D/appyinxiangcom/29884553/ENResource/p210)]
进入到以下目录
cd .....\protobuf-3.14.0\python
执行1
python setup.py build
执行结果1
...
copying google\protobuf\util\json_format_pb2.py -> build\lib\google\protobuf\util
copying google\protobuf\util\json_format_proto3_pb2.py -> build\lib\google\protobuf\util
copying google\protobuf\util\__init__.py -> build\lib\google\protobuf\util
执行2
python setup.py test
执行结果2
...
testZigZagEncode (google.protobuf.internal.wire_format_test.WireFormatTest) ... ok
----------------------------------------------------------------------
Ran 888 tests in 6.889s
OK (skipped=10)
执行3
python setup.py install
执行结果3
Finished processing dependencies for protobuf==3.14.0
欢迎大家交流学习,任何问题都可以留言