Skip to content

Commit 251fb70

Browse files
author
linwu
committed
fix: 修复Windows下subprocess调用失败的问题
在subprocess.check_call()中添加shell=True参数,解决Windows系统下 执行python.exe ensurepip --upgrade时出现CalledProcessError(returncode 2)的问题 - 添加shell=True参数到subprocess调用
1 parent a6fe8c0 commit 251fb70

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backend/plugin/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def install_requirements(plugin: str | None) -> None:
319319
pip_install = [sys.executable, '-m', 'pip', 'install', '-r', requirements_file]
320320
if settings.PLUGIN_PIP_CHINA:
321321
pip_install.extend(['-i', settings.PLUGIN_PIP_INDEX_URL])
322-
subprocess.check_call(ensurepip_install, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
322+
subprocess.check_call(ensurepip_install, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,shell=True)
323323
subprocess.check_call(pip_install, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
324324
except subprocess.CalledProcessError as e:
325325
raise PluginInstallError(f'插件 {plugin} 依赖安装失败:{e}') from e

0 commit comments

Comments
 (0)