MCPcopy Create free account
hub / github.com/ashfawk/oceanhazard-detection / run_command

Function run_command

setup_python.py:12–22  ·  view source on GitHub ↗

Run a command and handle errors

(command, description)

Source from the content-addressed store, hash-verified

10from pathlib import Path
11
12def run_command(command, description):
13 """Run a command and handle errors"""
14 print(f"🔄 {description}...")
15 try:
16 result = subprocess.run(command, shell=True, check=True, capture_output=True, text=True)
17 print(f"✅ {description} completed successfully")
18 return True
19 except subprocess.CalledProcessError as e:
20 print(f"❌ {description} failed:")
21 print(f"Error: {e.stderr}")
22 return False
23
24def check_python_version():
25 """Check if Python version is compatible"""

Callers 2

install_requirementsFunction · 0.85
install_spacy_modelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected