我们在项目中使用 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/