[Bug] 添加了bocha web_searcher 在使用过程中报错

Open Beginner friendly
#6,570 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Start at backend/app/astrbot/builtin_stars/web_searcher/main.py, especially the readability import, then inspect the project's dependency declarations and packaging for the web_searcher plugin. Reproduce the Windows startup path and verify that lxml.html is available and the web_searcher plugin loads without the ModuleNotFoundError.

Written by the indexing model from the issue text.

Description

area:core bug plugin-cate:tooling
What happened / 发生了什么

在完成astrbot配置,在使用过程中配置了 web_searcher API。但在AI运行过程中进行了报错

Reproduce / 如何复现?

似乎在配置了bocha API后一直都不太能正常使用

AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器

4.20.1

OS

Windows

Logs / 报错日志

[2026-03-18 18:09:13.245] [Core] [INFO] [star.star_manager:744]: 正在载入插件 web_searcher ...
[2026-03-18 18:09:13.307] [Core] [ERRO] [v4.20.1] [star.star_manager:756]: Traceback (most recent call last):
File "\?\C:\AIAgent\AstrBot\backend\app\astrbot\core\star\star_manager.py", line 342, in import_plugin_with_dependency_recovery
return import(path, fromlist=[module_str])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\?\C:\AIAgent\AstrBot\backend\app\astrbot\builtin_stars\web_searcher\main.py", line 8, in
from readability import Document
File "C:\AIAgent\AstrBot\backend\python\Lib\site-packages\readability_init
.py", line 3, in
from .readability import Document
File "C:\AIAgent\AstrBot\backend\python\Lib\site-packages\readability\readability.py", line 12, in
from lxml.html import document_fromstring
ModuleNotFoundError: No module named 'lxml.html'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "\?\C:\AIAgent\AstrBot\backend\app\astrbot\core\star\star_manager.py", line 748, in load
module = await self._import_plugin_with_dependency_recovery(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\?\C:\AIAgent\AstrBot\backend\app\astrbot\core\star\star_manager.py", line 363, in import_plugin_with_dependency_recovery
return import(path, fromlist=[module_str])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\?\C:\AIAgent\AstrBot\backend\app\astrbot\builtin_stars\web_searcher\main.py", line 8, in
from readability import Document
File "C:\AIAgent\AstrBot\backend\python\Lib\site-packages\readability_init
.py", line 3, in
from .readability import Document
File "C:\AIAgent\AstrBot\backend\python\Lib\site-packages\readability\readability.py", line 12, in
from lxml.html import document_fromstring
ModuleNotFoundError: No module named 'lxml.html'
[2026-03-18 18:09:13.308] [Core] [ERRO] [v4.20.1] [star.star_manager:757]: 插件 web_searcher 导入失败。原因:No module named 'lxml.html'

Are you willing to submit a PR? / 你愿意提交 PR 吗?
  • Yes!
Code of Conduct
Dominant language
Python
Stars
40.7k
Forks
2.9k
Avg merge
1d 5h
Merged PRs (30d)
112

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AstrBotDevs/AstrBot

All issues in AstrBotDevs/AstrBot

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.