Re: Python with PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp

1,817 views
Skip to first unread message

William Rowan

unread,
Jun 24, 2013, 7:49:07 PM6/24/13
to prot...@googlegroups.com
I'm having the same problem. It looks like the package on PyPI is missing the pyext directory that contains the sources for the extension. Browsing the repository I can see the missing files where they are expected to be in the source tree. It looks like the directory was just excluded from the upload to PyPI.

On Tuesday, June 4, 2013 5:59:33 AM UTC-7, Scott MacDonald wrote:
Hi all,

I am having issues trying to make use of the C++ binding for Python.  I am running Ubuntu 12.10, and trying to create a virtualenv to run some python applications that use protobufs.  I wanted to try using the PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp variable to measure the performance gains.

Any suggestions are GREATLY appreciated !

Here are the steps I followed:

user@system$ virtualenv API2
user@system$ export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp
user@system$ source API2/bin/activate
(API2)user@system$ export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp
(API2)user@system$ sudo PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp pip install protobuf
Downloading/unpacking protobuf from https://pypi.python.org/packages/source/p/protobuf/protobuf-2.5.0.tar.gz#md5=338813f3629d59e9579fed9035ecd457
  Running setup.py egg_info for package protobuf
    Using EXPERIMENTAL C++ Implmenetation.

Downloading/unpacking distribute from https://pypi.python.org/packages/source/d/distribute/distribute-0.6.45.tar.gz#md5=8953f2c07e6700dabf2ec150129b8c31 (from protobuf)
  Running setup.py egg_info for package distribute

Installing collected packages: protobuf, distribute
  Running setup.py install for protobuf
    Using EXPERIMENTAL C++ Implmenetation.
    building 'google.protobuf.internal._net_proto2___python' extension
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I. -I/usr/include/python2.7 -c google/protobuf/pyext/python_descriptor.cc -o build/temp.linux-x86_64-2.7/google/protobuf/pyext/python_descriptor.o
    x86_64-linux-gnu-gcc: error: google/protobuf/pyext/python_descriptor.cc: No such file or directory
    x86_64-linux-gnu-gcc: fatal error: no input files
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 4
    Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/protobuf/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-zOZjtw-record/install-record.txt --single-version-externally-managed:
    Using EXPERIMENTAL C++ Implmenetation.

running install

running build
creating build/lib.linux-x86_64-2.7

creating build/lib.linux-x86_64-2.7/google

creating build/lib.linux-x86_64-2.7/google/protobuf

creating build/lib.linux-x86_64-2.7/google/protobuf/internal

copying google/protobuf/internal/__init__.py -> build/lib.linux-x86_64-2.7/google/protobuf/internal

copying google/protobuf/internal/api_implementation.py -> build/lib.linux-x86_64-2.7/google/protobuf/internal

copying google/protobuf/internal/containers.py -> build/lib.linux-x86_64-2.7/google/protobuf/internal

copying google/protobuf/internal/cpp_message.py -> build/lib.linux-x86_64-2.7/google/protobuf/internal

copying google/protobuf/internal/decoder.py -> build/lib.linux-x86_64-2.7/google/protobuf/internal

copying google/protobuf/internal/encoder.py -> build/lib.linux-x86_64-2.7/google/protobuf/internal

copying google/protobuf/internal/enum_type_wrapper.py -> build/lib.linux-x86_64-2.7/google/protobuf/internal

copying google/protobuf/internal/message_listener.py -> build/lib.linux-x86_64-2.7/google/protobuf/internal

copying google/protobuf/internal/python_message.py -> build/lib.linux-x86_64-2.7/google/protobuf/internal

copying google/protobuf/internal/type_checkers.py -> build/lib.linux-x86_64-2.7/google/protobuf/internal

copying google/protobuf/internal/wire_format.py -> build/lib.linux-x86_64-2.7/google/protobuf/internal

copying google/protobuf/__init__.py -> build/lib.linux-x86_64-2.7/google/protobuf

copying google/protobuf/descriptor.py -> build/lib.linux-x86_64-2.7/google/protobuf

copying google/protobuf/descriptor_pb2.py -> build/lib.linux-x86_64-2.7/google/protobuf

creating build/lib.linux-x86_64-2.7/google/protobuf/compiler

copying google/protobuf/compiler/__init__.py -> build/lib.linux-x86_64-2.7/google/protobuf/compiler

copying google/protobuf/compiler/plugin_pb2.py -> build/lib.linux-x86_64-2.7/google/protobuf/compiler

copying google/protobuf/message.py -> build/lib.linux-x86_64-2.7/google/protobuf

copying google/protobuf/descriptor_database.py -> build/lib.linux-x86_64-2.7/google/protobuf

copying google/protobuf/descriptor_pool.py -> build/lib.linux-x86_64-2.7/google/protobuf

copying google/protobuf/message_factory.py -> build/lib.linux-x86_64-2.7/google/protobuf

copying google/protobuf/reflection.py -> build/lib.linux-x86_64-2.7/google/protobuf

copying google/protobuf/service.py -> build/lib.linux-x86_64-2.7/google/protobuf

copying google/protobuf/service_reflection.py -> build/lib.linux-x86_64-2.7/google/protobuf

copying google/protobuf/text_format.py -> build/lib.linux-x86_64-2.7/google/protobuf

copying google/__init__.py -> build/lib.linux-x86_64-2.7/google

running build_ext

building 'google.protobuf.internal._net_proto2___python' extension

creating build/temp.linux-x86_64-2.7

creating build/temp.linux-x86_64-2.7/google

creating build/temp.linux-x86_64-2.7/google/protobuf

creating build/temp.linux-x86_64-2.7/google/protobuf/pyext

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I. -I/usr/include/python2.7 -c google/protobuf/pyext/python_descriptor.cc -o build/temp.linux-x86_64-2.7/google/protobuf/pyext/python_descriptor.o

x86_64-linux-gnu-gcc: error: google/protobuf/pyext/python_descriptor.cc: No such file or directory

x86_64-linux-gnu-gcc: fatal error: no input files

compilation terminated.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 4

Feng Xiao

unread,
Jun 25, 2013, 4:18:47 PM6/25/13
to William Rowan, Protocol Buffers
Yes, the package uploaded to PyPI only contains the pure python implementation. To use the cpp implementation you'll need to download the source tar from the download page and build it from source.

--
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 http://groups.google.com/group/protobuf.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages