Ljzd-PRO / Mys_Goods_Tool

米游社商品兑换工具 | 短信验证登录 | 终端图形界面
https://pypi.org/project/mys-goods-tool
MIT License
458 stars 70 forks source link

手动修改user_data文件后报错,读取用户数据文件失败,请检查用户数据文件 user_data.json 是否存在且程序有权限读取和写入 #120

Closed HorizenX1 closed 1 year ago

HorizenX1 commented 1 year ago

PS C:\Users\xh104> .\Mys_Goods_Tool.exe .\Mys_Goods_Tool.exe : 无法将“.\Mys_Goods_Tool.exe”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼 写,如果包括路径,请确保路径正确,然后再试一次。 所在位置 行:1 字符: 1

PS C:\Users\xh104> cd C:\Users\xh104\Desktop\dist PS C:\Users\xh104\Desktop\dist> .\Mys_Goods_Tool.exe 2023-06-16 10:54:04.414 | ERROR | mys_goods_tool.user_data:load_config:503 - 读取用户数据文件失败,请检查用户数据文件 user_data.json 是否存在且程序有权限读取和写入 Traceback (most recent call last):

File "init.py", line 3, in

File "", line 1178, in _find_and_load File "", line 1149, in _find_and_load_unlocked File "", line 690, in _load_unlocked

File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module

File "mys_goods_tool__main__.py", line 6, in

File "", line 1178, in _find_and_load File "", line 1149, in _find_and_load_unlocked File "", line 690, in _load_unlocked

File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module

File "mys_goods_tool\user_data.py", line 518, in

File "mys_goods_tool\user_data.py", line 498, in load_config

File "pydantic\main.py", line 569, in pydantic.main.BaseModel.parse_file

File "pydantic\main.py", line 526, in pydantic.main.BaseModel.parse_obj

File "mys_goods_tool\user_data.py", line 428, in init

File "pydantic\main.py", line 339, in pydantic.main.BaseModel.init

File "pydantic\main.py", line 1076, in pydantic.main.validate_model

File "pydantic\fields.py", line 886, in pydantic.fields.ModelField.validate

File "pydantic\fields.py", line 1021, in pydantic.fields.ModelField._validate_mapping_like

File "pydantic\fields.py", line 1094, in pydantic.fields.ModelField._validate_singleton

File "pydantic\fields.py", line 884, in pydantic.fields.ModelField.validate

File "pydantic\fields.py", line 1101, in pydantic.fields.ModelField._validate_singleton

File "pydantic\fields.py", line 1157, in pydantic.fields.ModelField._apply_validators

File "pydantic\class_validators.py", line 337, in pydantic.class_validators._generic_validator_basic.lambda13

File "pydantic\main.py", line 711, in pydantic.main.BaseModel.validate

File "mys_goods_tool\user_data.py", line 229, in init

File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module

File "mys_goods_tool\utils.py", line 20, in

ImportError: cannot import name 'config' from partially initialized module 'mys_goods_tool.user_data' (most likely due to a circular import) (C:\Users\xh104\AppData\Local\Temp_MEI125002\mys_goods_tool\user_data.pyc) Traceback (most recent call last): File "mys_goods_tool\user_data.py", line 498, in load_config File "pydantic\main.py", line 569, in pydantic.main.BaseModel.parse_file File "pydantic\main.py", line 526, in pydantic.main.BaseModel.parse_obj File "mys_goods_tool\user_data.py", line 428, in init File "pydantic\main.py", line 339, in pydantic.main.BaseModel.init File "pydantic\main.py", line 1076, in pydantic.main.validate_model File "pydantic\fields.py", line 886, in pydantic.fields.ModelField.validate File "pydantic\fields.py", line 1021, in pydantic.fields.ModelField._validate_mapping_like File "pydantic\fields.py", line 1094, in pydantic.fields.ModelField._validate_singleton File "pydantic\fields.py", line 884, in pydantic.fields.ModelField.validate File "pydantic\fields.py", line 1101, in pydantic.fields.ModelField._validate_singleton File "pydantic\fields.py", line 1157, in pydantic.fields.ModelField._apply_validators File "pydantic\class_validators.py", line 337, in pydantic.class_validators._generic_validator_basic.lambda13 File "pydantic\main.py", line 711, in pydantic.main.BaseModel.validate File "mys_goods_tool\user_data.py", line 229, in init File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module File "mys_goods_tool\utils.py", line 20, in ImportError: cannot import name 'config' from partially initialized module 'mys_goods_tool.user_data' (most likely due to a circular import) (C:\Users\xh104\AppData\Local\Temp_MEI125002\mys_goods_tool\user_data.pyc)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "init.py", line 3, in File "", line 1178, in _find_and_load File "", line 1149, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module File "mys_goods_tool__main__.py", line 6, in File "", line 1178, in _find_and_load File "", line 1149, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module File "mys_goods_tool\user_data.py", line 518, in File "mys_goods_tool\user_data.py", line 504, in load_config NameError: name 'exit' is not defined [7944] Failed to execute script 'init' due to unhandled exception!

Ljzd-PRO commented 1 year ago

是修改了哪些部分呢