Skip to content

Build error #207

@surfiniaburger

Description

@surfiniaburger

Hi! I noticed there is currently a build error, here is a suggested fix.

Failure reason (from the logs)

  • The pip install step fails while preparing metadata for chess (a dependency of textarena). The error is:
    "ERROR: Can not execute setup.py since setuptools is not available in the build environment."
  • In short: the build environment is missing setuptools (and wheel). pip is trying to build a source distribution that runs setup.py and fails because setuptools isn't installed in the isolated build environment.

Fix (short)

  • Ensure pip, setuptools and wheel are installed/upgraded in the image before running pip install for your project dependencies. Add a step that upgrades pip/setuptools/wheel prior to any pip install -r ... or prior to the uv pip install step in the builder image.

Concrete code changes to apply

  • Update the base/builder Dockerfile (so uv/pyproject installs run with setuptools available) and any env-specific Dockerfiles that run pip install -r requirements.txt.

Example patch suggestions:

  1. src/core/containers/images/Dockerfile (builder stage)

Before
RUN --mount=type=cache,target=/root/.cache/uv
uv pip install --system -r pyproject.toml

After
RUN --mount=type=cache,target=/root/.cache/uv
# Ensure pip, setuptools and wheel exist in the build environment
uv pip install --system --upgrade pip setuptools wheel &&
uv pip install --system -r pyproject.toml

  1. src/envs/atari_env/server/Dockerfile

Before
COPY src/envs/atari_env/server/requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt && rm /tmp/requirements.txt

After
COPY src/envs/atari_env/server/requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir --upgrade pip setuptools wheel &&
pip install --no-cache-dir -r /tmp/requirements.txt && rm /tmp/requirements.txt

  1. src/envs/browsergym_env/server/Dockerfile

Before
COPY src/envs/browsergym_env/server/requirements.txt /tmp/browsergym_requirements.txt
RUN pip install --no-cache-dir -r /tmp/browsergym_requirements.txt &&
rm /tmp/browsergym_requirements.txt

After
COPY src/envs/browsergym_env/server/requirements.txt /tmp/browsergym_requirements.txt
RUN pip install --no-cache-dir --upgrade pip setuptools wheel &&
pip install --no-cache-dir -r /tmp/browsergym_requirements.txt &&
rm /tmp/browsergym_requirements.txt

Notes and alternatives

  • Upgrading pip/setuptools/wheel first is the lowest friction fix and addresses the "setup.py requires setuptools" failure.
  • If you prefer not to modify images, you can also:
    • Add a top-level RUN pip install --upgrade pip setuptools wheel in the Dockerfile right before any pip install command that triggers the error.
    • Pin textarena (or its transitive dependency chess) to a version that provides a binary wheel for the target platform, avoiding source builds.
    • Add a pyproject/build-system dependency for any in-repo packages that require build-time setuptools (if applicable).
  • If packages require compilation, you may also need apt build dependencies (build-essential, python3-dev, etc.). The current failure is specifically missing setuptools so start with the steps above.

How to validate locally / in CI

  • Rebuild the failing image locally to confirm:
    docker build -f src/core/containers/images/Dockerfile -t openenv-base:fix .
    docker build -f src/envs/atari_env/server/Dockerfile -t atari-env:fix .

  • Re-run the GitHub Actions workflow after pushing the Dockerfile changes.

Suggested commit message

  • "docker: ensure pip/setuptools/wheel are installed before installing dependencies to fix build isolation errors"

References (files edited)

This change should resolve the metadata-generation-failed / setuptools missing error seen in the logs.

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