Android Market API - Python ImportError:没有名为 google.protobuf 的模块

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18969358/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 12:28:13  来源:igfitidea点击:

Android Market API - Python ImportError: No module named google.protobuf

pythongoogle-play

提问by Siddharthan Asokan

Based on Python-APIthe 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?

知道这里出了什么问题吗?

采纳答案by Yusuf X

Use pip:

使用

sudo pip install protobuf

I had the same problem, which is how I found your question, and this fixed it.

我遇到了同样的问题,这就是我发现你的问题的方式,这解决了它。

回答by saneryee

Use conda, if you use anaconda and juypter

使用 conda,如果您使用 anaconda 和 juypter

conda install -c conda-forge protobuf=3.2.0