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-API,我已经配置并安装了协议缓冲区(如http://worthynote.blogspot.com/2011/05/protobuf-compiler-on-mac.html中所述)和python 2.7。当我运行命令时
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?
有什么想法在这里出错吗?
2 个解决方案
#1
44
Use pip:
sudo pip install protobuf
I had the same problem, which is how I found your question, and this fixed it.
我有同样的问题,这是我找到你的问题的方法,并修复了它。
#2
1
Use conda, if you use anaconda and juypter
如果你使用anaconda和juypter,请使用conda
conda install -c conda-forge protobuf=3.2.0
#1
44
Use pip:
sudo pip install protobuf
I had the same problem, which is how I found your question, and this fixed it.
我有同样的问题,这是我找到你的问题的方法,并修复了它。
#2
1
Use conda, if you use anaconda and juypter
如果你使用anaconda和juypter,请使用conda
conda install -c conda-forge protobuf=3.2.0