我正在尝试使用“xmltodict”将 XML 转换为 JSON
我的代码:
import xmltodict
import json
with open('ELT.xml') as inFh:
with open('ELT.json','w') as outFh:
json.dump(xmltodict.parse(inFh.read()), outFh)
错误:
import xmltodict
ModuleNotFoundError: No module named 'xmltodict'
我试过: pip install xmltodict 但得到了这个结果:
C:\Users\user>pip install xmltodict
Requirement already satisfied: xmltodict in c:\users\user\anaconda3\lib\site-packages (0.12.0)