AttributeError: 'Response' object has no attribute 'json'

来源:互联网 发布:无锡大数据 编辑:程序博客网 时间:2024/06/05 19:32

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了。

0 0