No module named google.protobuf No module named google.protobuf python python

No module named google.protobuf


There is another possibility, if you are running a python 2.7.11 or other similar versions,

sudo pip install protobuf

is ok.

But if you are in a anaconda environment, you should use

conda install protobuf


Locating the google directory in the site-packages directory (for the proper latter directory, of course) and manually creating an (empty) __init__.py resolved this issue for me.

(Note that within this directory is the protobuf directory but my installation of Python 2.7 did not accept the new-style packages so the __init__.py was required, even if empty, to identify the folder as a package folder.)

...In case this helps anyone in the future.


In my case I

  1. downloaded the source code, compiled and installed:

    $ ./configure$ make$ make check$ sudo make install`
  2. for python I located its folder(python) under source code, and ran commands:

    $ python setup.py build$ python setup.py install'

Not sure if this could help you..