I initially used a pure python implementation of protocol buffers, but I changed it later to use the c++ library implementation. So I installed protobuf using these github instructions and then I followed these instructions to use the C++ implementation. But when I use api_implementation.Type(), it still returns 'python'. Why is it still using the python implementation? If this function should not be used, then what should I use to check implementation?I'm using protocol buffers 2.6.1 on CentOS.
--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.
[localhost python]$ sudo python setup.py build --cpp_implementaion
Installed [...]/protobuf-2.6.1/python/.eggs/google_apputils-0.4.2-py2.7.eggSearching for python-gflags>=1.4Best match: python-gflags 3.0.5Processing python-gflags-3.0.5.tar.gzWriting /tmp/easy_install-c_jdOd/python-gflags-3.0.5/setup.cfgRunning python-gflags-3.0.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-c_jdOd/python-gflags-3.0.5/egg-dist-tmp-M2uDeXzip_safe flag not set; analyzing archive contents...Moving python_gflags-3.0.5-py2.7.egg to /home/oi.lee/Downloads/protobuf-2.6.1/python/.eggs
Installed [...]/protobuf-2.6.1/python/.eggs/python_gflags-3.0.5-py2.7.eggSearching for python-dateutil>=1.4Best match: python-dateutil 2.5.3Processing python-dateutil-2.5.3.zipWriting /tmp/easy_install-F99Iys/python-dateutil-2.5.3/setup.cfgRunning python-dateutil-2.5.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-F99Iys/python-dateutil-2.5.3/egg-dist-tmp-YXfHJwwarning: no previously-included files matching '__pycache__' found anywhere in distributionwarning: no previously-included files matching '*.py[co]' found anywhere in distributionMoving python_dateutil-2.5.3-py2.7.egg to /home/oi.lee/Downloads/protobuf-2.6.1/python/.eggs
Installed [...]/protobuf-2.6.1/python/.eggs/python_dateutil-2.5.3-py2.7.eggusage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help
error: option --cpp_implementaion not recognized
[localhost git]$ python testfile.py Traceback (most recent call last): File "testfile.py", line 4, in <module> import test File "[...]/Documents/git/test.py", line 4, in <module> import proto.DSMessagesv3_pb2 as msg File "[...]/Documents/git/proto/DSMessagesv3_pb2.py", line 6, in <module> from google.protobuf import descriptor as _descriptor File "/usr/lib/python2.7/site-packages/google/protobuf/descriptor.py", line 50, in <module> from google.protobuf.pyext import _messageImportError: cannot import name _message
if api_implementation.Version() == 2: from google.protobuf.pyext import _message else: from google.protobuf.internal import cpp_message
$ export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp
$ export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION=2