Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: No matching distribution found for Flask==2.0.2 #373

Open
MrRespicio opened this issue Aug 27, 2023 · 3 comments
Open

ERROR: No matching distribution found for Flask==2.0.2 #373

MrRespicio opened this issue Aug 27, 2023 · 3 comments
Labels

Comments

@MrRespicio
Copy link

MrRespicio commented Aug 27, 2023

Describe the bug
I'm following the tutorial on https://docker-curriculum.com on Dockerfile section.

To Reproduce
Steps to reproduce the behavior:

  1. I cloned the repository as instructed in the guide.
    $ git clone https://github.com/prakhar1989/docker-curriculum.git
    $ cd docker-curriculum/flask-app

  2. And created a Dockerfile inside docker-curriculum/flask-app.

  3. Here's my Docker file:
    FROM python:3.8 WORKDIR /usr/src/app COPY . . RUN pip install --no-cache-dir -r requirements.txt EXPOSE 5000 CMD ["python", "./app.py"]

  4. And ran this command,
    docker build -t mlvrespicio/catnip .

Expected behavior
Docker images should be created.

Screenshots
I got this error while creating the docker image.
docker build -t mlvrespicio/catnip .
[+] Building 124.0s (8/8) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 340B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/python:3.8 7.4s
=> [1/4] FROM docker.io/library/python:3.8@sha256:28f1561fe0279d606b8543d8e2cd54abb7ec58ad4bbca19a065db1229cf3aa27 11.7s
=> => resolve docker.io/library/python:3.8@sha256:28f1561fe0279d606b8543d8e2cd54abb7ec58ad4bbca19a065db1229cf3aa27 0.0s
=> => sha256:28f1561fe0279d606b8543d8e2cd54abb7ec58ad4bbca19a065db1229cf3aa27 1.86kB / 1.86kB 0.0s
=> => sha256:4f372691895ada3e85a9ebb181ad24dfe319a56cbd1a54949a0142a5a0c40de3 245B / 245B 0.8s
=> => sha256:47c0268b48e9672b440eb5c3bf3f98196336ca02bcc0a1c7ccc06466b99bb3f0 2.85MB / 2.85MB 8.9s
=> => sha256:d80126e7fe0b93c09abbaeb0c9e41a82da66a59f7904ca4967def0a54e756d53 17.28MB / 17.28MB 10.7s
=> => sha256:c3ac277830cfe6d4b092c9e58f6295ac79f6091e7aa602c505e7c887c6b6f513 2.01kB / 2.01kB 0.0s
=> => sha256:8902dbffd68e9befb64c37179f3bd802af491cd46ce0246aac21e97e6c57fdc7 7.56kB / 7.56kB 0.0s
=> => extracting sha256:d80126e7fe0b93c09abbaeb0c9e41a82da66a59f7904ca4967def0a54e756d53 0.5s
=> => extracting sha256:4f372691895ada3e85a9ebb181ad24dfe319a56cbd1a54949a0142a5a0c40de3 0.0s
=> => extracting sha256:47c0268b48e9672b440eb5c3bf3f98196336ca02bcc0a1c7ccc06466b99bb3f0 0.2s
=> [internal] load build context 0.0s
=> => transferring context: 508B 0.0s
=> [2/4] WORKDIR /usr/src/app 0.1s
=> [3/4] COPY . . 0.0s
=> ERROR [4/4] RUN pip install --no-cache-dir -r requirements.txt 104.6s

[4/4] RUN pip install --no-cache-dir -r requirements.txt:
16.74 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/flask/
32.28 WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/flask/
48.32 WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/flask/
65.37 WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/flask/
84.41 WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/flask/
99.46 ERROR: Could not find a version that satisfies the requirement Flask==2.0.2 (from versions: none)
99.46 ERROR: No matching distribution found for Flask==2.0.2


Dockerfile:10

8 |
9 | # install dependencies
10 | >>> RUN pip install --no-cache-dir -r requirements.txt
11 |
12 | # tell the port number the container should expose

ERROR: failed to solve: process "/bin/sh -c pip install --no-cache-dir -r requirements.txt" did not complete successfully: exit code:

Desktop (please complete the following information):

  • OS: Windows 11
  • Docker Version 24.0.5

Additional context
Add any other context about the problem here.

@MrRespicio MrRespicio added the bug label Aug 27, 2023
@MrRespicio MrRespicio changed the title [BUG] ERROR: No matching distribution found for Flask==2.0.2 Aug 27, 2023
@mdetrano
Copy link

I had this issue and for me this was the result of tweaks I had made in the firewall preventing the container from reaching the internet.

@mperdikeas
Copy link

Just to say I am facing the exact same issue on Ubuntu 20.04 (in case that has any bearing) and with a clean git clone ("git status -s" is clean). I append my trace:

image

@mperdikeas
Copy link

Ok, so in the end, adding "--network host" worked. I.e. the following command:

docker build . --network host -t /catnip

This was mentioned here:

StefanScherer/dockerfiles-windows#270 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants