Skip to content

fix(docker): apt install python3-pip first — v1.4.3 round 2#6

Closed
notabotchef wants to merge 1 commit intomainfrom
fix/dockerfile-pip-round2
Closed

fix(docker): apt install python3-pip first — v1.4.3 round 2#6
notabotchef wants to merge 1 commit intomainfrom
fix/dockerfile-pip-round2

Conversation

@notabotchef
Copy link
Copy Markdown
Owner

@notabotchef notabotchef commented Apr 12, 2026

Summary

v1.4.2's pip fix was incomplete. The next docker-publish run got past the bare pip issue but immediately hit:

#12 0.117 /usr/bin/python3: No module named pip

frdel/agent-zero-run ships python3 without the pip module bundled. So both pip (v1.4.1) and python3 -m pip (v1.4.2) fail for the same root cause: pip is simply not installed.

Fix

RUN apt-get update \
    && apt-get install -y --no-install-recommends python3-pip \
    && rm -rf /var/lib/apt/lists/* \
    && python3 -m pip install --no-cache-dir --break-system-packages \
        "websockets>=13.1,<17.0" \
        "cryptography>=42.0,<45.0" \
        pyyaml \
    && for venv_pip in /opt/venv/bin/pip /a0/venv/bin/pip /usr/local/venv/bin/pip; do \
        if [ -x "$venv_pip" ]; then \
            "$venv_pip" install --no-cache-dir \
                "websockets>=13.1,<17.0" \
                "cryptography>=42.0,<45.0" \
                pyyaml; \
        fi; \
    done
  • apt-get install python3-pip first — guarantees pip exists. Adds ~5 MB and one layer.
  • python3 -m pip install --break-system-packages for PEP 668 (Debian Bookworm+).
  • Loop over candidate A0 venv paths (/opt/venv, /a0/venv, /usr/local/venv) and install the same packages into any that exist. Belt-and-suspenders for whichever Python A0 hands the plugin at runtime.

Test plan

  • bash -n of the RUN block — clean
  • plugin.yaml → 1.4.3
  • README badge + What's New entry
  • docker-publish.yml green on the v1.4.3 tag

Files

  • Dockerfile — apt install python3-pip + venv loop
  • plugin.yaml — version 1.4.3
  • README.md — version badge + What's New entry

v1.4.2 still failed to build:

  #12 0.117 /usr/bin/python3: No module named pip

The frdel/agent-zero-run base image ships python3 but does NOT bundle
the pip module — so `python3 -m pip` fails the same way bare `pip`
did. Need to install pip via apt before we can use it.

Fix:
- apt-get install -y python3-pip first (one extra layer)
- python3 -m pip install --break-system-packages (PEP 668)
- Loop over candidate A0 venv paths (/opt/venv, /a0/venv,
  /usr/local/venv) and install into each that exists, so the agent
  runtime sees the same packages regardless of which Python A0 hands
  the plugin

Bumps to 1.4.3, README What's New entry explains both rounds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant