Skip to content

🔥 Cannot start mongodb_api: ModuleNotFoundError: No module named 'agents' #4

@Marxist-Leninist

Description

@Marxist-Leninist

Let’s wrap it up with a clean, ready‑to‑paste GitHub Issue / internal bug ticket.
Below is a draft that captures everything we discovered, including the exact commands, error logs, and the most likely root cause (missing agents package). https://chatgpt.com/s/t_688773da7b988191878deecb31a95fa4

🔥 Cannot start mongodb_api: ModuleNotFoundError: No module named 'agents'
Environment
Item Value
Host Codespace / Docker (Ubuntu 22.04)
Python 3.10.18 (CPython) inside conda env asi‑arch
Key deps we re‑installed fastapi 0.110.3, uvicorn 0.35.0, pydantic 2.11.7
Repo commit INSERT_SHA_HERE
Command that fails uvicorn mongodb_api:app --reload --host 0.0.0.0 --port 8000

Steps to Reproduce
bash
Copy
Edit

clone repo

git clone <repo_url> && cd ASI-Arch

create env & install

conda env create -f environment.yml # or: conda create -n asi-arch python=3.10
conda activate asi-arch

(we switched from GraalPy → CPython to avoid pydantic_core issues)

conda install -y -c conda-forge "python=3.10.* _cpython" --update-deps --force-reinstall
pip install --no-cache-dir -U "pydantic-core==2.
" "pydantic==2." "fastapi==0.110." uvicorn

adjust PYTHONPATH so database layer can see top-level packages

export PYTHONPATH=$PWD:$PWD/pipeline:$PYTHONPATH

start API

cd database
uvicorn mongodb_api:app --host 0.0.0.0 --port 8000 --reload
Observed Output (truncated)
pgsql
Copy
Edit
ModuleNotFoundError: No module named 'agents'
↳ /database/util.py:10 from agents import Runner
What we tried
Attempt Result
find . -name agents* No internal agents/ package in repo
pip install agents (DeepMind RL) Import succeeded but doesn’t expose Runner → subsequent TensorFlow 1.x era errors (tf.contrib, etc.)
Added stub agents/init.py with class Runner: pass Lets FastAPI boot, confirming the only blocker is the missing package.
git submodule update --init --recursive No sub‑modules present.

Analysis
util.py expects an internal library agents.Runner that is not part of the repo or any modern PyPI release.

The DeepMind package agents (RL) is unrelated and incompatible.

Likely scenarios:

agents lives in a private repo meant to be installed side‑by‑side (sub‑module or separate clone).

The code was renamed (e.g., agents → pipeline.agents) but imports weren’t updated.

The dependency used to be vendored and was accidentally removed from the repo history.

Requested Action
Provide / restore the agents package that contains at least the Runner class.

Document setup steps (README / environment.yml) so new devs can bootstrap without guesswork.

Optional: publish agents to an internal PyPI or convert to a proper sub‑module.

Feel free to tweak the wording, add the exact commit hash, or attach full logs. Once the maintainers supply the missing package (or update the import), the rest of the stack should work.

Let me know if you’d like any changes before you file it!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions