Dockerfile Error RUN pip install -r requirements.txt

Hi , i am pretty new for docker,
I just try to write a docker file for a python flask web app. but it gives an error:
ERROR: could not find a version that satisfies the requirement python==3.10.5(from versions:none)
ERROR: no matching distribution found for python==3.10.5

Hier is my requirements.txt:

python==3.10.5
alembic==1.8.1
click==8.1.3
distlib==0.3.5
filelock==3.8.0
Flask==2.1.3
Flask-Migrate==3.1.0
Flask-SQLAlchemy==2.5.1
greenlet==1.1.2
itsdangerous==2.1.2
Jinja2==3.1.2
Mako==1.2.1
MarkupSafe==2.1.1
platformdirs==2.5.2
SQLAlchemy==1.4.40
virtualenv==20.16.3
Werkzeug==2.1.2

and hier is my docker file:

Dockerfile, Image, Container

FROM python:3.10.5

#convention to create an environment variable
#it will set the value this environment variable to 1
ENV PYTHONUNBUFFERED 1
RUN pip install --upgrade pip

#create directory
#RUN apt-get update -y && \ apt-get install -y python-pip python-dev
RUN mkdir /app

#working directory
WORKDIR /app

#copy everything to this expected /code going to be created within oour container

copy the requierements.txt and installing each of the dependency on this container

#it will be copied in /code/
COPY requirements.txt .

####WORKDIR /tmp
#we want to make sure that each of our dependencies are going to be installed in our container
RUN pip install -r requirements.txt
#RUN pip install --requirements requirements.txt

#copy the entire project to the directory that we have created
COPY . .

#entrypoint of our container
CMD [“python”, “./app.py”]

please help me , I can’t find my mistake…
thank u so much for

Hi

have you tried to remove “python==3.10.5” from requirements?

hi, thx for your answer…I have removed it. it is done. but I have a question. is it not important to have it in requirements?

Im not an expert in python, but i would mean it dosnt need to install python, because its allready in the image

thank u very much for the fast answer…I’ll try it and then give a feedback hier…:slight_smile:

it works , thx so much…

1 Like