mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-05 02:31:47 +00:00
Add helpful ImportError messages for optional dependencies
When optional dependencies are missing, raise ImportError with installation instructions pointing to the relevant extras group (e.g. `[messaging]`, `[cli]`, `[mcp]`, etc.) instead of letting the import fail silently.
This commit is contained in:
parent
79a5f03f92
commit
2df306e6cd
9 changed files with 81 additions and 14 deletions
|
|
@ -1504,7 +1504,13 @@ def _snapshot_child_pids() -> set:
|
|||
pass
|
||||
|
||||
# Fallback: psutil
|
||||
import psutil
|
||||
try:
|
||||
import psutil
|
||||
except ImportError:
|
||||
raise ImportError(
|
||||
"psutil is required for MCP child process tracking. "
|
||||
"Install with: pip install hermes-agent[mcp]"
|
||||
) from None
|
||||
try:
|
||||
return {c.pid for c in psutil.Process(my_pid).children()}
|
||||
except psutil.Error:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue