Farama-Foundation / Arcade-Learning-Environment

The Arcade Learning Environment (ALE) -- a platform for AI research.
https://ale.farama.org/
GNU General Public License v2.0
2.18k stars 424 forks source link

ale-py installation issue in Docker image #574

Open jugheadjones10 opened 1 week ago

jugheadjones10 commented 1 week ago
FROM python:3.10

ENV DEBIAN_FRONTEND=noninteractive 
RUN apt-get update && \
    apt-get -y install python3-pip
RUN ln -s /usr/bin/python3 /usr/bin/python

ARG CACHE_BUST=$(date +%s)
RUN echo "$CACHE_BUST" && python --version

RUN pip install --upgrade pip setuptools wheel

RUN pip install ale-py

Building the above gives this error: 3.350 ERROR: Failed building wheel for ale-py 3.350 Failed to build ale-py 3.366 ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (ale-py)

I've tried many python versions and ale-versions, to no avail.

jugheadjones10 commented 1 week ago

Have tried a lot a lot of things but I just can't seem to get ale-py to install properly in Docker

pseudo-rnd-thoughts commented 1 week ago

What is the install error?

jugheadjones10 commented 1 week ago

@pseudo-rnd-thoughts 6.062 ERROR: Failed building wheel for ale-py 6.063 Failed to build ale-py 6.154 ERROR: Could not build wheels for ale-py which use PEP 517 and cannot be installed directly

jugheadjones10 commented 1 week ago

Another error I often see when trying out different base images and Docker configurations:

4.666 RuntimeError 4.666 4.666 Unable to find installation candidates for ale-py (0.8.1)

jugheadjones10 commented 1 week ago

Ok after a ton of trial and error I found these very specific conditions under which it will work:

# Use the official Python image with a compatible version
FROM python:3.9-slim

# Set environment variables to prevent prompts during package installations
ENV DEBIAN_FRONTEND=noninteractive

# Install system dependencies, including SDL2 development libraries
RUN apt-get update && \
    apt-get -y install \
        python3-pip \
        xvfb \
        ffmpeg \
        git \
        build-essential \
        cmake \
        zlib1g-dev \
        libbz2-dev \
        libpng-dev \
        libopencv-dev \
        libsdl2-dev 
RUN ln -s /usr/bin/python3 /usr/bin/python

RUN pip install poetry --upgrade
COPY pyproject.toml pyproject.toml
COPY poetry.lock poetry.lock

RUN poetry install

(ale-py 0.10.1 is listed as a dependency in pyproject.toml)