首页 > 代码库 > 解决:AttributeError: module 'requests' has no attribute 'get'”

解决: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'”