Android Market API - Python ImportError: No module named google.protobuf
30,615
Solution 1
Use pip:
sudo pip install protobuf
I had the same problem, which is how I found your question, and this fixed it.
Solution 2
Use conda, if you use anaconda and juypter
conda install -c conda-forge protobuf=3.2.0
Related videos on Youtube
Comments
-
Siddharthan Asokan over 1 year
Based on Python-API the requirements I have configured and installed the protocol buffers (as mentioned in http://worthynote.blogspot.com/2011/05/protobuf-compiler-on-mac.html ) and python 2.7. When I ran the command
python examples.py
and still faced the error:
File "examples.py", line 3, in <module> import market_proto File "/Users/siddharthan64/Downloads/android-market-api-py-master/market_proto.py", line 3, in <module> from google.protobuf import descriptor ImportError: No module named google.protobuf
Any idea whats going wrong here?
-
MarkHu over 9 yearsGlad this finally works. Previous versions were not
pip
-installable. -
Guig over 7 yearswhy do you need to sudo?
-
rph over 7 years@Guig You will need sudo if your python is installed under root directories. If your python is installed under your home (or somewhere you own permissions) you don't need sudo. In such cases you need to specify pip to install under the "user" location:
pip install --user module_name
. You can check more here: stackoverflow.com/questions/7465445/…. -
Flair over 6 yearsWhat if I get the import error, but protobuf is already installed?
-
Flair over 6 yearsAh I just realize that my Cellar/python is called instead of my bin/python