解决:AttributeError: module 'requests' has no attribute 'get'”

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决:AttributeError: module 'requests' has no attribute 'get'”相关的知识,希望对你有一定的参考价值。

今天学习Requests库,当用pip install requests安装后,写了一段代码报错:AttributeError: module ‘requests‘ has no attribute ‘get‘”

技术分享

技术分享

后从https://www.zhihu.com/question/57011609得到答案,原来是我的代码文件命名为requests.py 了。赶紧改了,发现ok:

技术分享

以上是关于解决:AttributeError: module 'requests' has no attribute 'get'”的主要内容,如果未能解决你的问题,请参考以下文章

成功解决AttributeError: module ‘tensorflow‘ has no attribute ‘reset_default_graph‘daiding

Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法

Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法

解决AttributeError: module ‘serial‘ has no attribute ‘Serial‘

解决:AttributeError: module 'requests' has no attribute 'get'”

异常解决-- AttributeError: cannot assign module before Module.__init__() call