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

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

你可能感兴趣的:(Python,Requests)