Build Cloud-Native apps with Apache Cassandra

GOT QUESTIONS from the Workshop? You're in the right place! Post a question here and we'll get you answers.

Click here for Week 8 Materials and Homework.

Follow us on Eventbrite to get notified when new workshops are scheduled!


question

chandrasekar.b03_190734 avatar image
chandrasekar.b03_190734 asked ·

pip install for week 6 exercise fails with "No matching distribution for flask"

This time i run week 6 exercise on my local system. i built my astra-ui docker image successfully.

when i try to built docker image for python backend using,

docker build ./getting-started-with-astra-python -t astra-backend:my-image

I'm getting this error,

Sending build context to Docker daemon  70.66kB
Step 1/6 : FROM python:alpine3.7
alpine3.7: Pulling from library/python
48ecbb6b270e: Pull complete
692f29ee68fa: Pull complete
6439819450d1: Pull complete
3c7be240f7bf: Pull complete
ca4b349df8ed: Pull complete
Digest: sha256:35f6f83ab08f98c727dbefd53738e3b3174a48b4571ccb1910bae480dcdba847
Status: Downloaded newer image for python:alpine3.7
 ---> 00be2573e9f7
Step 2/6 : COPY . /app
 ---> 3c81837ceab0
Step 3/6 : WORKDIR /app
 ---> Running in 835a3e51c8f2
Removing intermediate container 835a3e51c8f2
 ---> edb127ec1e3b
Step 4/6 : RUN pip install -r requirements.txt
 ---> Running in fa1c714bf989
Collecting flask (from -r requirements.txt (line 1))
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fece490c358>: Failed to establish a new connection: [Errno -3] Try again')': /simple/flask/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fece490c7b8>: Failed to establish a new connection: [Errno -3] Try again')': /simple/flask/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fece490c748>: Failed to establish a new connection: [Errno -2] Name does not resolve')': /simple/flask/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fece490c5c0>: Failed to establish a new connection: [Errno -3] Try again')': /simple/flask/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fece490c3c8>: Failed to establish a new connection: [Errno -2] Name does not resolve')': /simple/flask/
  Could not find a version that satisfies the requirement flask (from -r requirements.txt (line 1)) (from versions: )
No matching distribution found for flask (from -r requirements.txt (line 1))
The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1

How could i solve this error?

Kindly acknowledge ASAP. Why because again if i don't have enough resources, then i should extend my cloud instance for some more extra time.

Any help will be very much appreciable :)

workshop
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

bettina.swynnerton avatar image
bettina.swynnerton answered ·

Hi @chandrasekar.b03_190734,

this seems to be due to a connection error while running the pip install command, which might have just been a temporary issue with your network connectivity.

Have you tried building the docker image again since you posted this issue?

Thanks!

3 comments Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Hi @bettina.swynnerton

i have tried many times until my laptop needs charging. Nothing happening as expected. Same error persists.


Do you remember our discussion, when i did the week 3 exercise on my local system using pycharm and i get the same error for this flask package.

0 Likes 0 · ·

Hi @chandrasekar.b03_190734,

the docker build is independent from your local installation. The pip install operates here purely within the scope of the python distribution used for building this docker image, based on Python 3.7.

And it is a network error, it is obviously trying to establish a connection and failing.

Network connectivity is required while you are building the image. It looks to me that the build is failing as soon as it needs to go to the network.

I tested it here again myself and built a fresh image, and flask is the first dependency that is downloaded.

If you think that this is purely an issue with the flask package, you can remove it from the requirements.txt and see if it build then, however it is a needed component, and the image would not be fit for purpose without flask.


0 Likes 0 · ·

I have researched this more, and the following stackoverflow post has some good hints where else to look for understanding why this is failing on your local machine:

https://stackoverflow.com/questions/54708164/pip-install-fails-on-docker-build

Perhaps this helps to understand this further and gets you closer to fixing this issue, it seems to be problem with your particular laptop setup and the docker installation.

0 Likes 0 · ·
Erick Ramirez avatar image
Erick Ramirez answered ·

I think we've come to the point where we can no longer keep troubleshooting issues in your local environment. You would have to agree that we have spent so much time assisting you with the various issues you continually encounter on your laptop.

This isn't sustainable and it isn't fair to other users who also need our assistance. This is a big drain on our resources and I'm going to have to end this now. We can't keep doing this any longer. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.