1.5 KiB
Failure Archive Entry
Issue
CLI commands failed with ModuleNotFoundError: No module named 'numpy' (and similar for pandas, aiohttp, fastapi, uvicorn).
Attempt
Multiple attempts to run CLI commands after sibling branch integration; observed import errors when commands tried to load service modules.
Approach
Initially attempted to fix by adjusting PYTHONPATH manually and creating a virtualenv. Discovered that the CLI virtualenv did not include required scientific and web dependencies.
Root Cause
The aitbc-cli package in pyproject.toml did not declare dependencies that the service modules require. The coordinator-api services import numpy, pandas, aiohttp, fastapi, and uvicorn, but these were not listed under the CLI package's dependencies, leading to import failures when the CLI imported service modules.
Resolution
Added the following to root pyproject.toml dependencies:
numpy>=1.26.0
pandas>=2.0.0
aiohttp>=3.9.0
fastapi>=0.111.0
uvicorn[standard]>=0.30.0
Then reinstalled the CLI in editable mode: pip install -e ./cli.
Useful Artifacts
- The list of required packages is now part of the canonical dependency set.
- The fix allowed all CLI commands (
surveillance,ai_trading,advanced_analytics,regulatory,compliance,ai_surveillance) to load successfully.
Prevention
- Keep shared dependencies in a central
pyproject.tomlthat covers both services and CLI. - Implement an import test in CI that verifies CLI commands can import without error.
Archived on 2026-03-15.