Python can't find google.protobuf error

python can't find google.protobuf error
Error: ImportError: No module named google.protobuf
What’s going on: The google package is missing an init.py file.
How to fix it: Run pip show protobuf to check where protobuf is installed. If you don’t have it, install it with pip install protobuf. (You might see guides telling you to pip install google or pip install google-cloud, but for this fix, you don’t need those.)
cd into the folder shown by pip show, for example:
cd /home/weizy/miniconda3/envs/torchpy27/lib/python2.7/site-packages
Then cd one level down into the google directory. You’ll see a protobuf directory in there.
Now, inside the google directory, run:
touch __init__.py
Just an empty file. Head back to your Python file and try:
import google.protobuf
No more error.


