From e90b6f266cc545136a59cd3faf60610958dda44f Mon Sep 17 00:00:00 2001 From: Wu Clan Date: Sun, 11 Oct 2026 10:31:18 +0800 Subject: [PATCH] Fix plugin dependency index resolution (#1271) --- backend/plugin/requirements.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/plugin/requirements.py b/backend/plugin/requirements.py index aecec112..4bc17c91 100644 --- a/backend/plugin/requirements.py +++ b/backend/plugin/requirements.py @@ -89,13 +89,17 @@ def install_requirements(plugin: str | None) -> None: # ruff:ignore[complex-str if not _is_in_virtualenv(): pip_install.append('--system') if settings.PLUGIN_PIP_CHINA: - # 将国内源作为优先索引,同时保留 PyPI 作为回退来源 + # 使用 PyPI 作为优先索引,国内源作为回退来源 pip_install.extend([ - '--index', + '--default-index', settings.PLUGIN_PIP_INDEX_URL, + '--index', + 'https://pypi.org/simple/', '--index-strategy', 'unsafe-best-match', ]) + else: + pip_install.extend(['--index', 'https://pypi.org/simple/']) max_retries = settings.PLUGIN_PIP_MAX_RETRY for attempt in range(max_retries):