简体   繁体   English

在python脚本中导入json在intellij中不起作用

[英]import json in python script not working in intellij

I use json library for load json files.我使用 json 库来加载 json 文件。 In Visual Studio Code it works perfect, but in Intellij IDEA, I have problem.在 Visual Studio Code 中它运行良好,但在 Intellij IDEA 中,我遇到了问题。

在此处输入图像描述

When I try to use, I get error: AttributeError: module 'json' has no attribute 'loads'.当我尝试使用时,出现错误:AttributeError: module 'json' has no attribute 'loads'。 在此处输入图像描述

在此处输入图像描述

This is just in intellij problem.这只是 intellij 问题。 In databricks work fine.在数据块中工作正常。

在此处输入图像描述

在您使用的第一个屏幕截图中:“json.load” 在您使用的最后一个屏幕截图中:“json.loads”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM