Protobuf: Compiler module missing from Python 2.7 wheels

Created on 22 Mar 2017  路  7Comments  路  Source: protocolbuffers/protobuf

The google.protobuf.compiler module is missing in the Python 2.7 wheels for releases 3.2.0 and 3.0.0 on PyPI:
https://pypi.python.org/pypi/protobuf/3.2.0
https://pypi.python.org/pypi/protobuf/3.0.0

This only seems to affect the wheels for Python 2.7, which are only available on PyPI for those two releases. The module is still present in the source distribution and Python 3.x wheels.

To reproduce missing module error:

$ pip install protobuf==3.2.0
$ python
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import google.protobuf
>>> import google.protobuf.compiler
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named compiler

packaging & distribution python

Most helpful comment

This issue had stopped occurring with release 3.3.0, but has started reoccurring with 3.4.0:

Traceback (most recent call last):
  File "/usr/local/bin/protoc-gen-sidecar", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/home/vagrant/src/pysidecar/bin/protoc-gen-sidecar", line 6, in <module>
    from google.protobuf.compiler import plugin_pb2 as plugin
ImportError: No module named compiler

Uninstalling 3.4.0 and reinstalling 3.3.0 causes the issue to stop occurring.

All 7 comments

Is there any plan to create a point release of protobuf so that the most recent version does not have this issue?

This issue had stopped occurring with release 3.3.0, but has started reoccurring with 3.4.0:

Traceback (most recent call last):
  File "/usr/local/bin/protoc-gen-sidecar", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/home/vagrant/src/pysidecar/bin/protoc-gen-sidecar", line 6, in <module>
    from google.protobuf.compiler import plugin_pb2 as plugin
ImportError: No module named compiler

Uninstalling 3.4.0 and reinstalling 3.3.0 causes the issue to stop occurring.

+1 this regressed for me as well (macOS, installing protobuf via brew)

ping ping

If you run setup.py build before setup.py install then the compiler module is included.

+1 I'm running into the same issue on 3.5.1

I ran into this as well with the latest version available on brew (3.5.1), had to roll back to 2.6 as a workaround:

brew install [email protected]
brew link [email protected] --force
Was this page helpful?
0 / 5 - 0 ratings

Related issues

stub42 picture stub42  路  3Comments

louwersj picture louwersj  路  4Comments

supereagle picture supereagle  路  3Comments

MikeSilvis picture MikeSilvis  路  3Comments

twmht picture twmht  路  3Comments