Is there any way to access Protocol Buffers with python 3.x?

拥有回忆 提交于 2019-12-20 11:18:14

问题


We use Python 3.x in our projects. But the official client of Protocol Buffers only supports python 2.x.

I don't want to downgrade to python 2.x.


回答1:


UPDATE 2: Python 3.x is natively supported as of version 3.0.0.

You can see versions released on GitHub here: https://github.com/protocolbuffers/protobuf/releases

UPDATE: The stable version of protobuf, 2.6.1, does not support Python 3.x. However, the newer 3.0.0 release (still in beta) supports Python 3.x. You can see versions released on PyPi here: https://pypi.python.org/pypi/protobuf

No, there isn't. There is a discussion on the protobuf google group about Python 3.X support. It indicates that Google wants to keep support for Python 2.4, so porting to Python 3.X is not easy. If the project branches or can drop support for Python 2.4 and 2.5, it would be a lot easier to port.




回答2:


Here is the newer fork of most recent version of protobuf (2.5.0 + arm64 patches) at the moment that supports Python 3 and still backward compatible with Python 2.4: https://github.com/GreatFruitOmsk/protobuf-py3




回答3:


The latest version of Google Protocol Buffers (2.6) added Python 3 support. I suggest using that.

EDIT: Nevermind. They lied in their release notes.




回答4:


There is a compatible implantation for python 3.x. https://github.com/openx/python3-protobuf




回答5:


This package should be the alpha version of Python 3 Protocol Buffer by Google.

https://github.com/google/protobuf/releases/download/v3.0.0-alpha-3/protobuf-python-3.0.0-alpha-3.tar.gz




回答6:


Google's official library has supported Python 3 since version 3.0 (Jul 29, 2016).



来源:https://stackoverflow.com/questions/8663468/is-there-any-way-to-access-protocol-buffers-with-python-3-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!