From 9aa46f92dc7eb9907f5cb5de79377a42c6164839 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Mon, 10 Oct 2022 21:04:23 +0530 Subject: [PATCH] Check for uvicorn and set the PATH env variable before checking --- installer/installer/tasks/install_ui_packages.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/installer/installer/tasks/install_ui_packages.py b/installer/installer/tasks/install_ui_packages.py index bfbd3854..b7a442e8 100644 --- a/installer/installer/tasks/install_ui_packages.py +++ b/installer/installer/tasks/install_ui_packages.py @@ -1,5 +1,6 @@ import os import shutil +import platform from installer import app, helpers @@ -28,7 +29,11 @@ Downloading packages necessary for Stable Diffusion UI.. ''') def is_valid_env(): - if shutil.which("uvicorn") is None: + path = os.environ['PATH'] + path += os.path.join(app.project_env_dir_path, 'Scripts' if platform.system() == 'Windows' else 'bin') + + if shutil.which("uvicorn", path=path) is None: + helpers.log("uvicorn not found!") return False return helpers.modules_exist_in_env(('uvicorn', 'fastapi'))