Installation¶
PyOD 3 ships as a single pip-installable library plus optional agent activation paths. This guide covers every install variant, from a minimal core install to the full agentic stack.
Quickstart¶
Core library (required for every activation path):
pip install pyod
Then pick the activation path that matches your agent stack:
# 1. Claude Code / Claude Desktop — enables the od-expert skill
pyod install skill
# 2. Any MCP-compatible LLM — requires the optional mcp extra
pip install pyod[mcp]
pyod mcp serve # alias for `python -m pyod.mcp_server`
# 3. Pure Python — no extra step
# from pyod.utils.ad_engine import ADEngine
Run pyod info at any time to see version, detector counts, and the install state of each activation path.
Core library install¶
PyOD is distributed through both pip (PyPI) and conda (conda-forge). We recommend the latest version due to frequent updates:
pip install pyod # normal install
pip install --upgrade pyod # upgrade if already installed
conda users can install from conda-forge:
conda install -c conda-forge pyod
To install from source (useful for development):
git clone https://github.com/yzhao062/pyod.git
cd pyod
pip install .
Agentic activation paths¶
PyOD 3 supports three activation paths for AI agents. Pick the one that matches your agent stack; you can enable more than one in the same environment.
- Claude Code / Claude Desktop
The
od-expertskill ships as package data inside the pyod wheel and is copied into Claude Code’s skill directory via thepyod install skillcommand:pip install pyod pyod install skill # user-global → ~/.claude/skills/od-expert/ pyod install skill --project # project-local → ./skills/od-expert/ pyod install skill --list # list available packaged skills pyod install skill --target <path> # custom destination
After installing, run
pyod infoto confirm the skill is detected. The legacypyod-install-skillcommand from v3.0.0 is kept as a backward-compat alias and shares a single code path withpyod install skill.- Codex users
Codex does not have a user-global skill directory like Claude Code. It reads shared skills from
./skills/<skill-name>/in the project root, which is exactly the pathpyod install skill --projectwrites to. From a project directory, run:pyod install skill --project
Codex picks up
od-expertin that project automatically.pyod infodetects~/.codex/and reports Codex alongside Claude Code in its output.- MCP-compatible agents
The MCP server exposes PyOD tools to any MCP-compatible LLM (e.g., Claude Desktop via MCP, other agent frameworks). It requires the optional
mcpextra:pip install pyod[mcp] pyod mcp serve # alias for ``python -m pyod.mcp_server``
The server registers seven tools:
profile_data,plan_detection,build_detector,list_detectors,explain_detector,compare_detectors, andget_benchmarks.- Python apps / custom agents
Import and call PyOD’s orchestration layer directly:
from pyod.utils.ad_engine import ADEngine engine = ADEngine() state = engine.investigate(X_train)
No extra install step beyond
pip install pyod. See the Layer 3: Agentic Investigation walkthrough for a full conversation example.
Verifying your install¶
Run pyod info to check version, detector counts, and the install state of every activation path:
pyod info
Example output:
PyOD version: 3.1.0
Detectors (ADEngine): 61 total (43 tabular, 7 time-series, 8 graph, 2 text, 2 image, 1 multimodal, 3 audio)
Classic API: OK
ADEngine (Layer 2): OK
MCP extra: OK (run: pyod mcp serve)
od-expert skill: INSTALLED (user-global) at /Users/you/.claude/skills/od-expert/SKILL.md
If the od-expert skill line reads NOT INSTALLED but Claude Code is detected, run pyod install skill. If the MCP extra shows NOT INSTALLED and you want MCP access, run pip install pyod[mcp].
Required dependencies¶
Python 3.9 or higher
joblibmatplotlibnumpy>=1.19numba>=0.51scipy>=1.5.1scikit-learn>=0.22.0
Optional dependencies¶
Install only what you need:
|
|
|
|
|
|
|
|
|
Warning
PyOD includes several neural-network-based models, including AutoEncoders, VAE, DeepSVDD, and the graph detectors (DOMINANT, CoLA, etc.), all implemented in PyTorch. These deep learning libraries are not automatically installed by PyOD to avoid conflicts with existing installations. If you plan to use neural-net-based or graph detectors, install PyTorch (and torch_geometric for graph models) separately. Similarly, xgboost is not installed by default but is required for XGBOD.