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
Update the Docker Image:
docker build –pull -t my-python-app .
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
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
Check Python Version Inside Docker:
RUN python –version
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
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: