import了requests和json,但是在运行的时候报出“AttributeError: 'Response' object has no attribute 'json'”这样的错。后来在stackflow上看到类似的错误
http://stackoverflow.com/questions/22412873/attributeerror-response-object-has-no-attribute-json
原来是requests版本太旧的问题,先
print requests.__version__
0.10.6
不是最新版本的,于是update requests的版本,在CMD的命令行里输入以下命令
pip install --upgrade requests or easy_install requests
再运行就OK了。

文章详细介绍了如何通过检查并更新requests库版本来解决Python脚本中遇到的AttributeError: 'Response' object has no attribute 'json'错误,确保了代码的正常运行。
1747





