Before installing Safeguards, make sure you have:
- Python 3.10 or newer
- pip package manager
Install the package using pip:
pip install agent-safeguards
This will install the core package with all required dependencies.
For development work, install with additional development dependencies:
pip install agent-safeguards[dev]
This includes:
- Testing tools (pytest, pytest-asyncio, pytest-cov)
- Code formatting (black, isort)
- Linting (flake8)
- Type checking (mypy)
To build documentation locally:
pip install agent-safeguards[docs]
This includes:
- Sphinx documentation generator
- Read the Docs theme
- Type hints support
You can verify the installation by running:
from safeguards import BudgetManager, ResourceMonitor
from safeguards.types import Agent
# Should not raise any ImportError
The package requires psutil
for system resource monitoring. On some systems, you might need to install additional system packages:
sudo apt-get update
sudo apt-get install python3-dev
sudo yum install python3-devel
No additional system packages required.
No additional system packages required.
-
ImportError: No module named 'psutil'
pip install --no-cache-dir psutil
-
Build failures on Windows
pip install --upgrade setuptools wheel
-
Permission errors during installation
pip install --user agent-safeguards
For more issues, please check our GitHub Issues page.