No module named google.protobuf

lecorbu picture lecorbu · Jul 9, 2015 · Viewed 75.1k times · Source

I am trying to run Google's deep dream. For some odd reason I keep getting

ImportError: No module named google.protobuf

after trying to import protobuf. I have installed protobuf using sudo install protobuf. I am running python 2.7 OSX Yosemite 10.10.3.

I think it may be a deployment location issue but i cant find anything on the web about it. Currently deploying to /usr/local/lib/python2.7/site-packages.

Answer

Panfeng Li picture Panfeng Li · May 16, 2016

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