mirror of
				https://github.com/open-webui/open-webui
				synced 2025-06-26 18:26:48 +00:00 
			
		
		
		
	Merge pull request #9131 from 0xThresh/dev
fix: Add error catching for function pip install issues
This commit is contained in:
		
						commit
						8fdb37a17f
					
				@ -167,9 +167,14 @@ def load_function_module_by_id(function_id, content=None):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
def install_frontmatter_requirements(requirements):
 | 
					def install_frontmatter_requirements(requirements):
 | 
				
			||||||
    if requirements:
 | 
					    if requirements:
 | 
				
			||||||
 | 
					        try:
 | 
				
			||||||
            req_list = [req.strip() for req in requirements.split(",")]
 | 
					            req_list = [req.strip() for req in requirements.split(",")]
 | 
				
			||||||
            for req in req_list:
 | 
					            for req in req_list:
 | 
				
			||||||
                log.info(f"Installing requirement: {req}")
 | 
					                log.info(f"Installing requirement: {req}")
 | 
				
			||||||
                subprocess.check_call([sys.executable, "-m", "pip", "install", req])
 | 
					                subprocess.check_call([sys.executable, "-m", "pip", "install", req])
 | 
				
			||||||
 | 
					        except Exception as e:
 | 
				
			||||||
 | 
					            log.error(f"Error installing package: {req}")
 | 
				
			||||||
 | 
					            raise e
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    else:
 | 
					    else:
 | 
				
			||||||
        log.info("No requirements found in frontmatter.")
 | 
					        log.info("No requirements found in frontmatter.")
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user