python - 有没有办法使用 python 3.x 访问 Protocol Buffer ?

标签 python python-3.x protocol-buffers

我们在项目中使用 Python 3.x。但是Protocol Buffers官方客户端只支持python 2.x。

我不想降级到 python 2.x。

最佳答案

更新 2:Python 3.x 从版本 3.0.0 开始原生支持。

您可以在此处查看 GitHub 上发布的版本: https://github.com/protocolbuffers/protobuf/releases

更新:protobuf 的稳定版本 2.6.1 不支持 Python 3.x。但是,较新的 3.0.0 版本(仍处于测试阶段)支持 Python 3.x。你可以在这里查看 PyPi 上发布的版本: https://pypi.python.org/pypi/protobuf

不,没有。有一个discussion on the protobuf google group关于 Python 3.X 支持。这表明 Google 希望继续支持 Python 2.4,因此移植到 Python 3.X 并不容易。如果项目分支或可以放弃对 Python 2.4 和 2.5 的支持,移植会容易得多。

关于python - 有没有办法使用 python 3.x 访问 Protocol Buffer ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8663468/

相关文章:

protocol-buffers - 我可以定义带有空请求或响应的 grpc 调用吗?

c# - 如何添加(连接)两个 Google.Protobuf.ByteStrings? C#

Python无法安装包

python - 告诉多个生产者的消费者没有更多结果

python - Azure ML 无法部署终结点

python - 如何干净地写__getitem__?

python - 对字符串进行 URL 编码

python - 装饰器使用 for 循环但不使用 while 循环

python - 将 blob 图像从 sqlite db 插入 QPixMap 到 PyQt5 中的 QTextBrowser

c++ - Protobuf、CodedInputStream 解析部分消息