Skip to content

Commit 0fc9be8

Browse files
committed
fix: improve missing package error messages
Provide clear installation instructions when commands are missing rather than just stating they are not found.
1 parent e401d59 commit 0fc9be8

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

distribution/build.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,14 @@ def is_install_from_source(llama_stack_version):
4848
return "." not in llama_stack_version or "+rhai" in llama_stack_version
4949

5050

51-
def check_package_installed(package_name):
52-
"""Check if llama binary is installed and accessible."""
53-
if not shutil.which(package_name):
54-
print(f"Error: {package_name} not found. Please install it first.")
51+
def check_command_installed(command, package_name=None):
52+
"""Check if a command is installed and accessible.
53+
"""
54+
if not shutil.which(command):
55+
if package_name:
56+
print(f"Error: {command} not found. Please run uv pip install {package_name}")
57+
else:
58+
print(f"Error: {command} not found. Please install it.")
5559
sys.exit(1)
5660

5761

@@ -262,11 +266,10 @@ def generate_containerfile(dependencies, llama_stack_install):
262266

263267

264268
def main():
265-
check_package_installed("uv")
269+
check_command_installed("uv")
266270
install_llama_stack_from_source(LLAMA_STACK_VERSION)
267271

268-
print("Checking llama installation...")
269-
check_package_installed("llama")
272+
check_command_installed("llama", "llama-stack-client")
270273

271274
# Do not perform version check if installing from source
272275
if not is_install_from_source(LLAMA_STACK_VERSION):

0 commit comments

Comments
 (0)