Fix the subprocess check call failed in windows (#802)

* fix: 修复Windows下subprocess调用失败的问题

* fix: 修复代码格式问题
This commit is contained in:
yzbf
2025-09-09 16:21:51 +08:00
committed by GitHub
parent a6fe8c0e8d
commit b809497aba

View File

@@ -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