Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

若你遇到和我类似的加载失败,可参考我的解决方式 #110

Open
mrly2333 opened this issue Oct 21, 2024 · 4 comments
Open

Comments

@mrly2333
Copy link

你可能在nb plugin install后启动时nonebot_plugin_apscheduler报错:

If you use @root_validator with pre=False (the default) you MUST specify skip_on_failure=True. The skip_on_failure=False option is no longer available.

If you were not trying to set skip_on_failure=False, you can safely set skip_on_failure=True. If you do, this root validator will no longer be called if validation fails for any of the fields.

那么,在插件的config.py中第76行修改为:

@root_validator(skip_on_failure=True)

在nonebot_plugin_apscheduler插件的config.py中修改为以下加载项:

from pydantic import Field
from pydantic_settings import BaseSettings

最后,在虚拟环境(如果有)中执行pip install pydantic-settings

正确放置资源文件并设置文件目录后即可正常使用

@NikoCat233
Copy link

管用,万分感谢

@NikoCat233
Copy link

但是改了就和别的很多插件都冲突了 omg

@mrly2333
Copy link
Author

但是改了就和别的很多插件都冲突了 omg

我是没啥兼容性问题,实在不行部署多个nb吧

@NikoCat233
Copy link

这招妙啊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants