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
Share:
30,615

Related videos on Youtube

Siddharthan Asokan
Author by

Siddharthan Asokan

question2hack

Updated on August 24, 2022

Comments

  • Siddharthan Asokan
    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
    MarkHu over 9 years
    Glad this finally works. Previous versions were not pip-installable.
  • Guig
    Guig over 7 years
    why do you need to sudo?
  • rph
    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
    Flair over 6 years
    What if I get the import error, but protobuf is already installed?
  • Flair
    Flair over 6 years
    Ah I just realize that my Cellar/python is called instead of my bin/python

Related