Skip to content

Commit 6fcdf0b

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 6fcdf0b

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

distribution/build.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,15 @@ 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+
if not shutil.which(command):
54+
if package_name:
55+
print(
56+
f"Error: {command} not found. Please run uv pip install {package_name}"
57+
)
58+
else:
59+
print(f"Error: {command} not found. Please install it.")
5560
sys.exit(1)
5661

5762

@@ -262,11 +267,10 @@ def generate_containerfile(dependencies, llama_stack_install):
262267

263268

264269
def main():
265-
check_package_installed("uv")
270+
check_command_installed("uv")
266271
install_llama_stack_from_source(LLAMA_STACK_VERSION)
267272

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

271275
# Do not perform version check if installing from source
272276
if not is_install_from_source(LLAMA_STACK_VERSION):

0 commit comments

Comments
 (0)