MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / install_dependency

Function install_dependency

Scripts/Developer Base/Devices Finder.py:99–116  ·  view source on GitHub ↗
(package, is_pip=False)

Source from the content-addressed store, hash-verified

97# DEPENDENCIES
98# ─────────────────────────────────────────────
99def install_dependency(package, is_pip=False):
100 if is_pip:
101 cmd = [sys.executable, "-m", "pip", "install", package]
102 info(f"Installing Python package: {package}")
103 else:
104 cmd = ["pkg", "install", "-y", package]
105 info(f"Installing system package: {package}")
106
107 try:
108 result = subprocess.run(cmd, capture_output=True, text=True)
109 if result.returncode == 0:
110 success(f"Installed {package}")
111 return True
112 error(result.stderr.strip() or f"Could not install {package}")
113 return False
114 except Exception as exc:
115 error(f"Installation error for {package}: {exc}")
116 return False
117
118
119

Callers 1

check_dependenciesFunction · 0.70

Calls 4

infoFunction · 0.70
successFunction · 0.70
errorFunction · 0.70
runMethod · 0.45

Tested by

no test coverage detected