C4_W2_Lab_1_FastAPI_Docker issue with fastapi while building docker image

I was trying to build the docker image for the first ungraded lab from week2. On step 7 out of 8, when pip install is called, there is this issue that says

No matching distribution found for fastapi

I am working on WSL and I have not changed anything within either Dockerfile or requirements.txt. The screen shot of the error is like this:

Hello @Amir_Zare
You can first try ‘pip install --upgrade pip’ and ensure that your internet connection is stable

1 Like

Thanks, you gave me the clue I needed to find the solution.

I write this for people whose internet connection has restrictions like me. As @Isaak_Kamau mentioned the problem was with my connection. I already had sshuttle working as a vpn on my host and I took for granted that docker too would funnel its traffic through sshuttle just like all other services on my host.

But in order to so you need to add an extra argument to docker build command: --network=host. So finally by running docker build -t mlepc4w2-ugl:no-batch --network=host . everything worked properly.

1 Like

Welcome @Amir_Zare
Thanks for pointing this out. It will help other students!

Happy learning

1 Like

Hi @Isaak_Kamau, I am doing this C4_W2_Lab_1 and got stuck at Create the Dockerfile.
I am trying to run the Lab’s commands in Git Bash terminal on my Windows 11 PC with the following installed:
image

When I entered : [FROM frolvlad/alpine-miniconda3:python3.7] on the terminal, I get the error below. Hope you can spot any I have missed out.

sorry @Isaak_Kamau, it was my bad! I managed to complete the lab using Windows Terminal with Port 80 remapped to 8080. This issue can be closed. Sorry to disturb you.

1 Like