skip to Main Content

I’m trying to build dockerfile as below:

FROM python:3.10
RUN pip install ale-py

If I try to build, I get error msg like:

1.436 ERROR: Could not find a version that satisfies the requirement ale-py (from versions: none)
1.436 ERROR: No matching distribution found for ale-py

In my local env (+ also in venv with same python version) There is no problem to install ale-py

Is there any conflict between docker <-> ale-py?

2

Answers


    1. Update the Docker Image:

      docker build –pull -t my-python-app .

    2. Add pip Update Step:
      Sometimes the default pip version in Docker is outdated. Try updating it before installing ale-py:

      FROM python:3.10

      RUN pip install –upgrade pip

      RUN pip install ale-py

    3. Install System Dependencies:
      ale-py could have some system-level dependencies.

      FROM python:3.10
      RUN apt-get update && apt-get install -y
      build-essential
      libssl-dev
      libffi-dev
      python3-dev
      RUN pip install –upgrade pip
      RUN pip install ale-py

    4. Check Python Version Inside Docker:

      RUN python –version

    5. Use Virtual Environment in Docker:

      FROM python:3.10

      RUN python -m venv /opt/venv

      ENV PATH="/opt/venv/bin:$PATH"

      RUN pip install –upgrade pip

      RUN pip install ale-py

    Login or Signup to reply.
  1. Try To force a specific version, use the command: pip install ale-py==0.9.1 and then rebuild your docker image with the command: docker build --no-cache -t <image-name> .

    Alternatively, you can add the library to a requirements.txt file and then run: RUN pip install --no-cache-dir -r requirements.txt to install it.

    I have just tested this and its working:

    FROM python:3.10
    
    RUN pip install ale-py==0.9.1
    

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search