mirror of
https://github.com/open-webui/open-webui
synced 2025-06-25 09:47:41 +00:00
Merge pull request #11472 from thiswillbeyourgithub/better_frontmatter_pip_install3
fix: install all the requirements at the same time
This commit is contained in:
commit
0c5a1e84e3
@ -165,15 +165,14 @@ def load_function_module_by_id(function_id, content=None):
|
|||||||
os.unlink(temp_file.name)
|
os.unlink(temp_file.name)
|
||||||
|
|
||||||
|
|
||||||
def install_frontmatter_requirements(requirements):
|
def install_frontmatter_requirements(requirements: str):
|
||||||
if requirements:
|
if requirements:
|
||||||
try:
|
try:
|
||||||
req_list = [req.strip() for req in requirements.split(",")]
|
req_list = [req.strip() for req in requirements.split(",")]
|
||||||
for req in req_list:
|
log.info(f"Installing requirements: {' '.join(req_list)}")
|
||||||
log.info(f"Installing requirement: {req}")
|
subprocess.check_call([sys.executable, "-m", "pip", "install"] + req_list)
|
||||||
subprocess.check_call([sys.executable, "-m", "pip", "install", req])
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error(f"Error installing package: {req}")
|
log.error(f"Error installing packages: {' '.join(req_list)}")
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user