AttributeError: partially initialized module ‘requests’ has no attribute ‘get’ (most likely due to a circular import)
py文件不能以类名,包名命名。

解决方法:将文件名改为其他非类名、包名。
这篇博客探讨了一个常见的Python编程问题,即在使用requests库时遇到AttributeError,提示'partially initialized module 'requests' has no attribute 'get'。原因是由于循环导入导致requests模块未完全初始化。解决方案是避免将文件命名为与Python内置类或库同名,确保文件名的独特性以防止此类冲突。
AttributeError: partially initialized module ‘requests’ has no attribute ‘get’ (most likely due to a circular import)
py文件不能以类名,包名命名。

解决方法:将文件名改为其他非类名、包名。
您可能感兴趣的与本文相关的镜像
Python3.11
Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

被折叠的 条评论
为什么被折叠?