From b809497aba37509eb4392e6308d626ac265b984e Mon Sep 17 00:00:00 2001 From: yzbf <72718331+yzbf-lin@users.noreply.github.com> Date: Tue, 9 Sep 2025 16:21:51 +0800 Subject: [PATCH] Fix the subprocess check call failed in windows (#802) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 修复Windows下subprocess调用失败的问题 * fix: 修复代码格式问题 --- backend/plugin/tools.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/plugin/tools.py b/backend/plugin/tools.py index 3a285dfe..fb3174b1 100644 --- a/backend/plugin/tools.py +++ b/backend/plugin/tools.py @@ -319,7 +319,9 @@ def install_requirements(plugin: str | None) -> None: pip_install = [sys.executable, '-m', 'pip', 'install', '-r', requirements_file] if settings.PLUGIN_PIP_CHINA: pip_install.extend(['-i', settings.PLUGIN_PIP_INDEX_URL]) - subprocess.check_call(ensurepip_install, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + subprocess.check_call( + ensurepip_install, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, shell=True + ) subprocess.check_call(pip_install, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) except subprocess.CalledProcessError as e: raise PluginInstallError(f'插件 {plugin} 依赖安装失败:{e}') from e