From 9e41b8b024c2d4a9b72752801d4de83e88eea3bd Mon Sep 17 00:00:00 2001 From: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com> Date: Sun, 9 Mar 2025 23:38:23 +0100 Subject: [PATCH] fix: install all the requirements at the same time Signed-off-by: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com> --- backend/open_webui/utils/plugin.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/open_webui/utils/plugin.py b/backend/open_webui/utils/plugin.py index d6e24d6b9..91452a7ca 100644 --- a/backend/open_webui/utils/plugin.py +++ b/backend/open_webui/utils/plugin.py @@ -165,15 +165,14 @@ def load_function_module_by_id(function_id, content=None): os.unlink(temp_file.name) -def install_frontmatter_requirements(requirements): +def install_frontmatter_requirements(requirements: str): if requirements: try: req_list = [req.strip() for req in requirements.split(",")] - for req in req_list: - log.info(f"Installing requirement: {req}") - subprocess.check_call([sys.executable, "-m", "pip", "install", req]) + log.info(f"Installing requirements: {' '.join(req_list)}") + subprocess.check_call([sys.executable, "-m", "pip", "install"] + req_list) except Exception as e: - log.error(f"Error installing package: {req}") + log.error(f"Error installing packages: {' '.join(req_list)}") raise e else: