shewinder / shebot_nb2

GNU General Public License v3.0
2 stars 1 forks source link

更新后报错了 请问下是什么原因? #3

Open 0769559 opened 11 months ago

0769559 commented 11 months ago

PS C:\Users\Inuko\Desktop\vps\shebot_nb2> python run.py 10-11 01:08:09 [SUCCESS] nonebot | NoneBot is initializing... 10-11 01:08:09 [INFO] nonebot | Current Env: prod 10-11 01:08:14 [SUCCESS] nonebot | Succeeded to import "schedule_manage" 10-11 01:08:14 [SUCCESS] nonebot | Succeeded to import "service_manage" 10-11 01:08:14 [SUCCESS] nonebot | Succeeded to import "test" 10-11 01:08:14 [SUCCESS] nonebot | Succeeded to import "echo" 10-11 01:08:14 [SUCCESS] nonebot | Succeeded to import "help" 10-11 01:08:14 [SUCCESS] nonebot | Succeeded to import "zai" 10-11 01:08:15 [SUCCESS] nonebot | Succeeded to import "black" 10-11 01:08:15 [SUCCESS] nonebot | Succeeded to import "interact_handle" 10-11 01:08:15 [SUCCESS] nonebot | Succeeded to import "ls" 10-11 01:08:15 [SUCCESS] nonebot | Succeeded to import "listenmeta" 10-11 01:08:16 [SUCCESS] nonebot | Succeeded to import "rsspush" C:\Users\Inuko\AppData\Local\Programs\Python\Python38\lib\site-packages\fuzzywuzzy\fuzz.py:11: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning') 10-11 01:08:17 [SUCCESS] nonebot | Succeeded to import "yande" 10-11 01:08:17 [SUCCESS] nonebot | Succeeded to import "sync_tag" 10-11 01:08:17 [SUCCESS] nonebot | Succeeded to import "setuadd" 10-11 01:08:17 [SUCCESS] nonebot | Succeeded to import "setusearch" 10-11 01:08:17 [SUCCESS] nonebot | Succeeded to import "setu" 10-11 01:08:17 [SUCCESS] nonebot | Succeeded to import "greet" 10-11 01:08:17 [SUCCESS] nonebot | Succeeded to import "anti_msg_recall" 10-11 01:08:17 [SUCCESS] nonebot | Succeeded to import "broadcast" 10-11 01:08:17 [SUCCESS] nonebot | Succeeded to import "antiflash" 10-11 01:08:17 [ERROR] nonebot | Failed to import "pixivrank" Traceback (most recent call last): File "run.py", line 39, in nonebot.load_plugins(module) File "C:\Users\Inuko\AppData\Local\Programs\Python\Python38\lib\site-packages\nonebot\plugin__init__.py", line 1005, in load_plugins result = context.run(_load_plugin, manager, plugin_name)

File "C:\Users\Inuko\AppData\Local\Programs\Python\Python38\lib\site-packages\nonebot\plugin__init.py", line 953, in _load_plugin module = manager.load_plugin(plugin_name) File "C:\Users\Inuko\AppData\Local\Programs\Python\Python38\lib\site-packages\nonebot\plugin\manager.py", line 161, in load_plugin return importlib.import_module(f"{self.namespace}.{name}") File "C:\Users\Inuko\AppData\Local\Programs\Python\Python38\lib\importlib__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "C:\Users\Inuko\AppData\Local\Programs\Python\Python38\lib\site-packages\nonebot\plugin\manager.py", line 267, in exec_module super().exec_module(module) File "", line 844, in exec_module File "", line 981, in get_code File "", line 911, in source_to_code File "", line 219, in _call_with_frames_removed File "C:\Users\Inuko\Desktop\vps\shebot_nb2\hoshino/modules/pixiv\pixivrank\init__.py", line 220 @sucmd("预览日榜").handle() ^ SyntaxError: invalid syntax 10-11 01:08:17 [SUCCESS] nonebot | Succeeded to import "pidhelper" 10-11 01:08:17 [SUCCESS] nonebot | Running NoneBot... 10-11 01:08:17 [INFO] uvicorn | Started server process [29564] 10-11 01:08:18 [INFO] uvicorn | Waiting for application startup. 10-11 01:08:18 [INFO] nonebot_plugin_apscheduler | Scheduler Started

0769559 commented 11 months ago

好像弄明白了。File "C:\Users\Inuko\Desktop\vps\shebot_nb2\hoshino/modules/pixiv\pixivrank_init.py", line 220 @sucmd("预览日榜").handle()

把@替换成#号就好像没报错了 好不好用还得观望下

shewinder commented 11 months ago

@是装饰器语法,换成#是注释了该行,自然没有报错,但会导致该命令无法使用

0769559 commented 11 months ago

@是装饰器语法,换成#是注释了该行,自然没有报错,但会导致该命令无法使用

那请问应该怎么真正解决报错

shewinder commented 11 months ago

重新更新一下吧,应该是你更新的时候引入了语法错误,比如221行写了空行

0769559 commented 11 months ago

重新更新一下吧,应该是你更新的时候引入了语法错误,比如221行写了空行 重新git clone https://github.com/shewinder/shebot_nb2.git --depth=1到新的文件夹 把.env.prod基本设置弄了后启动起了没报错。但是看起来好像没运行pixiv?而额外添加个"pixiv" 运行起来又和前面一样的报错。

需要启用的模块

modules=["information", "entertainment", "setu", "groupmanage", "tools"]

PS C:\Users\Inuko\Desktop\vps\newnew\shebot_nb2> python run.py 10-11 22:28:42 [SUCCESS] nonebot | NoneBot is initializing... 10-11 22:28:42 [INFO] nonebot | Current Env: prod 10-11 22:28:44 [SUCCESS] nonebot | Succeeded to import "ls" 10-11 22:28:44 [SUCCESS] nonebot | Succeeded to import "test" 10-11 22:28:44 [SUCCESS] nonebot | Succeeded to import "echo" 10-11 22:28:44 [SUCCESS] nonebot | Succeeded to import "listenmeta" 10-11 22:28:44 [SUCCESS] nonebot | Succeeded to import "zai" 10-11 22:28:44 [SUCCESS] nonebot | Succeeded to import "black" 10-11 22:28:44 [SUCCESS] nonebot | Succeeded to import "schedule_manage" 10-11 22:28:44 [SUCCESS] nonebot | Succeeded to import "interact_handle" 10-11 22:28:44 [SUCCESS] nonebot | Succeeded to import "help" 10-11 22:28:44 [SUCCESS] nonebot | Succeeded to import "service_manage" 10-11 22:28:44 [SUCCESS] nonebot | Succeeded to import "rsspush" 10-11 22:28:44 [SUCCESS] nonebot | Succeeded to import "livenotice" 10-11 22:28:45 [SUCCESS] nonebot | Succeeded to import "imagegenerator" 10-11 22:28:45 [SUCCESS] nonebot | Succeeded to import "rua" 10-11 22:28:45 [SUCCESS] nonebot | Succeeded to import "creep" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "miragetank" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "conhead" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "poke" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "teasedragonking" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "wordle" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "emojimix" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "fortune" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "setu" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "sync_tag" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "setuadd" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "yande" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "antiflash" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "greet" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "anti_msg_recall" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "broadcast" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "bilibili" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "b64" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "xxr1000" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "translate" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "nbnhhsh" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "picsearch" 10-11 22:28:46 [SUCCESS] nonebot | Succeeded to import "ocr" 10-11 22:28:46 [SUCCESS] nonebot | Running NoneBot... 10-11 22:28:46 [INFO] uvicorn | Started server process [26528] 10-11 22:28:46 [INFO] uvicorn | Waiting for application startup. 10-11 22:28:46 [INFO] nonebot_plugin_apscheduler | Scheduler Started 10-11 22:28:46 [INFO] uvicorn | Application startup complete. 10-11 22:28:46 [INFO] hoshino | Scheduled job sync started. 10-11 22:28:46 [INFO] nonebot | downloading tags from https://api.shewinder.win/setu/tags 10-11 22:28:46 [INFO] uvicorn | Uvicorn running on http://127.0.0.1:19168 (Press CTRL+C to quit) 10-11 22:28:47 [INFO] uvicorn | ('127.0.0.1', 11039) - "WebSocket /cqhttp/ws" [accepted]

shewinder commented 11 months ago

本次更新并无实质内容更新,实在不行建议回退

0769559 commented 11 months ago

本次更新并无实质内容更新,实在不行建议回退

好的