ValueError: Expecting value: line 1 column 1 (char 0)
ValueError: Expecting value: line 1 column 1 (char 0)
json解析文件:
json_path=r"D:\data\tmp\data_similar\points_frame.json"try:with open(json_path, "r", encoding="utf-8") as f:annotation = json.load(f)print(annotation)except Exception as e:raise ValueError(f"json err {json_path}: {e}")
运行不报错,但是调试报错,
原因是,这个文件被notepad++打开了,解决方法:
把notepad++关掉就好了。