mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2026-03-13 09:31:31 +08:00
Fix the subprocess check call failed in windows (#802)
* fix: 修复Windows下subprocess调用失败的问题 * fix: 修复代码格式问题
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user