diff --git a/openbb_platform/core/openbb_core/build.py b/openbb_platform/core/openbb_core/build.py index 6596e9daafd..82f6bc6c006 100644 --- a/openbb_platform/core/openbb_core/build.py +++ b/openbb_platform/core/openbb_core/build.py @@ -10,14 +10,12 @@ import sys def main(): """Build the OpenBB platform static assets.""" try: - from openbb import build - - build() + import openbb # noqa except ( ImportError, ModuleNotFoundError, AttributeError, - ) as e: + ): print( # noqa: T201 "\nOpenBB build script not found, installing from PyPI...\n", ) @@ -25,14 +23,15 @@ def main(): [sys.executable, "-m", "pip", "install", "openbb", "--no-deps"], check=True, ) + try: subprocess.run( [sys.executable, "-c", "import openbb; openbb.build()"], check=True, ) - except (subprocess.CalledProcessError, AttributeError): + except Exception as e: raise RuntimeError( - "Failed to find the OpenBB build script. Install with `pip install openbb --no-deps`" + f"Failed to build the OpenBB platform static assets. \n{e}" ) from e