From ca2bb6f0ccc79ae489d53005004ebe67fd69e3b7 Mon Sep 17 00:00:00 2001 From: Eugene Brodsky Date: Fri, 2 Feb 2024 20:53:18 -0500 Subject: [PATCH] fix(installer): bubble up exceptions during install --- installer/lib/installer.py | 39 ++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/installer/lib/installer.py b/installer/lib/installer.py index beaa119d54..c28e94d720 100644 --- a/installer/lib/installer.py +++ b/installer/lib/installer.py @@ -215,25 +215,32 @@ class InvokeAiInstance: src = f"invokeai=={version}" if version is not None else "invokeai" - from plumbum import FG, local # type: ignore + from plumbum import FG, ProcessExecutionError, local # type: ignore pip = local[self.pip] + _ = pip["install", "--upgrade", "pip"] & FG - _ = ( - pip[ - "install", - "--require-virtualenv", - "--force-reinstall", - "--use-pep517", - str(src) + (optional_modules if optional_modules else ""), - "--find-links" if find_links is not None else None, - find_links, - "--extra-index-url" if extra_index_url is not None else None, - extra_index_url, - pre, - ] - & FG - ) + pipeline = pip[ + "install", + "--require-virtualenv", + "--force-reinstall", + "--use-pep517", + str(src) + (optional_modules if optional_modules else ""), + "--find-links" if find_links is not None else None, + find_links, + "--extra-index-url" if extra_index_url is not None else None, + extra_index_url, + pre, + ] + + try: + _ = pipeline & FG + except ProcessExecutionError as e: + print(f"Error: {e}") + print( + "Could not install InvokeAI. Please try downloading the latest version of the installer and install again." + ) + sys.exit(1) def configure(self): """