MCPcopy
hub / github.com/PromtEngineer/localGPT / check_prerequisites

Method check_prerequisites

run_system.py:187–211  ·  view source on GitHub ↗

Check if all required tools are available.

(self)

Source from the content-addressed store, hash-verified

185 return s.connect_ex(('localhost', port)) == 0
186
187 def check_prerequisites(self) -> bool:
188 """Check if all required tools are available."""
189 self.logger.info("🔍 Checking prerequisites...")
190
191 missing_tools = []
192
193 # Check Ollama
194 if not self._command_exists('ollama'):
195 missing_tools.append('ollama (https://ollama.ai)')
196
197 # Check Python
198 if not self._command_exists('python') and not self._command_exists('python3'):
199 missing_tools.append('python')
200
201 # Check Node.js (optional)
202 if not self._command_exists('npm'):
203 self.logger.warning("⚠️ npm not found - frontend will be disabled")
204 self.services['frontend'].required = False
205
206 if missing_tools:
207 self.logger.error(f"❌ Missing required tools: {', '.join(missing_tools)}")
208 return False
209
210 self.logger.info("✅ All prerequisites satisfied")
211 return True
212
213 def _command_exists(self, command: str) -> bool:
214 """Check if a command exists in PATH."""

Callers 1

start_allMethod · 0.95

Calls 1

_command_existsMethod · 0.95

Tested by

no test coverage detected