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

启动报错 #10

Open
lintonxue00 opened this issue Mar 22, 2023 · 1 comment
Open

启动报错 #10

lintonxue00 opened this issue Mar 22, 2023 · 1 comment

Comments

@lintonxue00
Copy link

[PyBot][06:53:54.465][ERROR] [plugin]插件导入失败 "nonebot_plugin_pixivrank_search"
Traceback (most recent call last):
File "/root/Yunzai-Bot/plugins/py-plugin/main.py", line 15, in
yunzai_nonebot.load_plugin(plugin.replace("-", "_"))
File "/root/.cache/pypoetry/virtualenvs/py-plugin-8_cve6GP-py3.9/lib/python3.9/site-packages/nonebot/plugin/load.py", line 34, in load_plugin
return manager.load_plugin(module_path)

File "/root/Yunzai-Bot/plugins/py-plugin/yunzai_nonebot/hijack/plugin.py", line 16, in load_plugin
module = importlib.import_module(name)
File "/usr/local/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "/root/.cache/pypoetry/virtualenvs/py-plugin-8_cve6GP-py3.9/lib/python3.9/site-packages/nonebot/plugin/manager.py", line 233, in exec_module
super().exec_module(module)
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/root/.cache/pypoetry/virtualenvs/py-plugin-8_cve6GP-py3.9/lib/python3.9/site-packages/nonebot_plugin_pixivrank_search/init.py", line 5, in
from .data_source import get_pixiv_urls, download_pixiv_imgs, search_pixiv_urls
File "/root/.cache/pypoetry/virtualenvs/py-plugin-8_cve6GP-py3.9/lib/python3.9/site-packages/nonebot_plugin_pixivrank_search/data_source.py", line 5, in
from .config import config
File "/root/.cache/pypoetry/virtualenvs/py-plugin-8_cve6GP-py3.9/lib/python3.9/site-packages/nonebot_plugin_pixivrank_search/config.py", line 10, in
config = Config.parse_obj(get_driver().config)
File "/root/.cache/pypoetry/virtualenvs/py-plugin-8_cve6GP-py3.9/lib/python3.9/site-packages/pydantic/main.py", line 526, in parse_obj
return cls(**obj)
File "/root/.cache/pypoetry/virtualenvs/py-plugin-8_cve6GP-py3.9/lib/python3.9/site-packages/pydantic/main.py", line 341, in init
raise validation_error
pydantic.error_wrappers.ValidationError: 1 validation error for Config
local_proxy
field required (type=value_error.missing)这个报错什么意思

这个报错是因为 nonebot_plugin_pixivrank_search 插件中的 Config 模型中缺少了必填的 local_proxy 字段。在 config.py 文件中,应该包含 local_proxy 字段的定义,例如:

python
Copy code
class Config(BaseSettings):
search_size: int = 10
local_proxy: Optional[str] = None # 添加这行定义
您需要在 config.py 中添加该字段的定义,或在使用该插件时,传递该字段的值。

@lintonxue00
Copy link
Author

配置没有填好

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

1 participant