From 71fee28cdee4e67ea89b2b9b22fa6964841dc32b Mon Sep 17 00:00:00 2001 From: Yao Chi Date: Wed, 23 Apr 2025 13:09:53 +0800 Subject: [PATCH] show how to install manually msg when error happens (#398) * show how to install manually msg when error happens * update version of BizyAir --- prestartup_script.py | 34 +++++++++++++++++----------------- pyproject.toml | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/prestartup_script.py b/prestartup_script.py index baa52ec..4535ec0 100644 --- a/prestartup_script.py +++ b/prestartup_script.py @@ -154,9 +154,8 @@ def install_dependencies(): ): try: print(f"\033[92m[BizyAir]\033[0m Try to install depency {package}") - subprocess.check_call( - [sys.executable, "-m", "pip", "install", package] - ) + install_comamnd = [sys.executable, "-m", "pip", "install", package] + subprocess.check_call(install_comamnd) except subprocess.CalledProcessError as e: print(f"\033[91m[BizyAir]\033[0m Failed to install {package}: {e}") continue @@ -199,9 +198,8 @@ def update_bizyengine_bizyui(): try: if package_name not in installed_packages: print(f"\033[92m[BizyAir]\033[0m Try to install {package_name}") - subprocess.check_call( - [sys.executable, "-m", "pip", "install", package_name] - ) + update_command = [sys.executable, "-m", "pip", "install", package_name] + subprocess.check_call(update_command) else: latest_version = get_latest_stable_version_from_pip( mirror_pip_url, package_name @@ -218,18 +216,20 @@ def update_bizyengine_bizyui(): ) return print(f"\033[92m[BizyAir]\033[0m UPDATE {package_name} NOW") - subprocess.check_call( - [ - sys.executable, - "-m", - "pip", - "install", - "--upgrade", - package_name, - ] - ) + update_command = [ + sys.executable, + "-m", + "pip", + "install", + "--upgrade", + package_name, + ] + subprocess.check_call(update_command) except Exception as e: - print(f"Error happens when update {package_name} packages: {str(e)}") + print( + f"\033[92m[BizyAir]\033[0m Error happens when update {package_name} packages: {str(e)}" + f"\n{' '*10}Try to update manually: \033[91m{' '.join(update_command)}\033[0m" + ) installed_packages = { dist.metadata["Name"]: Version(dist.version) diff --git a/pyproject.toml b/pyproject.toml index 9d447c9..62054ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ name = "bizyair" description = "[a/BizyAir](https://github.com/siliconflow/BizyAir) Comfy Nodes that can run in any environment." license = { file = "LICENSE" } -version = "1.2.2" +version = "1.2.3" [project.urls] Repository = "https://github.com/siliconflow/BizyAir"