Python 属性异常AttributeError: module 'json' has no attribute 'dumps'

简介: 错误信息:E:\python\data>python json.pyTraceback (most recent call last): File "json.

错误信息:

E:\python\data>python json.py
Traceback (most recent call last):
  File "json.py", line 3, in <module>
    import json
  File "E:\python\data\json.py", line 11, in <module>
    json_str = json.dumps(data)
AttributeError: module 'json' has no attribute 'dumps'
img_93750b2ed0a86cf0a64044a94e4b6bc1.png
异常.png

错误原因:

自己创建的Python文件名与系统的文件名重复.

解决方法:

修改自己创建的Python文件名称.

目录
相关文章
|
监控 数据挖掘 API
快应用报错Module Error 分包要求 app.json#minPlatformVersion 不小于 1061, 当前值为 21解决方案-优雅草卓伊凡
快应用报错Module Error 分包要求 app.json#minPlatformVersion 不小于 1061, 当前值为 21解决方案-优雅草卓伊凡
293 0
|
Python
python Module使用
【10月更文挑战第14天】 python Module使用
427 35
|
Linux Python
【Azure Function】Python Function部署到Azure后报错No module named '_cffi_backend'
ERROR: Error: No module named '_cffi_backend', Cannot find module. Please check the requirements.txt file for the missing module.
527 2
|
API Python
python属性错误(AttributeError)
【7月更文挑战第13天】
2356 10
|
数据处理 Python
【Python】解决tqdm ‘module‘ object is not callable
在使用tqdm库时遇到的“'module' object is not callable”错误,并给出了正确的导入方式以及一些使用tqdm的常见示例。
935 1
|
API C++ Python
【Azure 应用服务】Python fastapi Function在Azure中遇见AttributeError异常(AttributeError: 'AsgiMiddleware' object has no attribute 'handle_async')
【Azure 应用服务】Python fastapi Function在Azure中遇见AttributeError异常(AttributeError: 'AsgiMiddleware' object has no attribute 'handle_async')
331 0
|
关系型数据库 MySQL Linux
【Azure 应用服务】[App Service For Linux(Function) ] Python ModuleNotFoundError: No module named 'MySQLdb'
【Azure 应用服务】[App Service For Linux(Function) ] Python ModuleNotFoundError: No module named 'MySQLdb'
261 0
|
数据采集 机器学习/深度学习 人工智能
Python:现代编程的首选语言
Python:现代编程的首选语言
1780 102
|
数据采集 机器学习/深度学习 算法框架/工具
Python:现代编程的瑞士军刀
Python:现代编程的瑞士军刀
566 104
|
人工智能 自然语言处理 算法框架/工具
Python:现代编程的首选语言
Python:现代编程的首选语言
465 103

热门文章

最新文章

推荐镜像

更多