Flask app built successfully but failed to deploy

I am currently trying to deploy my flask app on render using its web service. It is a dynamic app that needs update from Firebase. However I am facing the problem where there the build was successful but the deploying phase failed. It says gunicorn app:app command not found, but I do have it in my requirements.txt, with the version 20.1.0. Therefore I’d like help on this

Mar 12 05:07:14 PM  ==> Cloning from https://github.com/Flov9/website-for-DGA-tools...
Mar 12 05:07:15 PM  ==> Checking out commit 9e99659909d9ad5953a11213153079b214948b30 in branch main
Mar 12 05:07:19 PM  ==> Using Python version: 3.7.10
Mar 12 05:07:23 PM  ==> Running build command 'find . -regex '.*requirements.txt$''...
Mar 12 05:07:23 PM  ./requirements.txt
Mar 12 05:07:23 PM  ==> Generating container image from build. This may take a few minutes...
Mar 12 05:08:36 PM  ==> Uploading build...
Mar 12 05:09:07 PM  ==> Build uploaded in 25s
Mar 12 05:09:07 PM  ==> Build successful 🎉
Mar 12 05:09:07 PM  ==> Deploying...
Mar 12 05:09:29 PM  ==> Starting service with 'gunicorn app:app'
Mar 12 05:09:29 PM  bash: gunicorn: command not found
Mar 12 05:09:36 PM  ==> Starting service with 'gunicorn app:app'
Mar 12 05:09:36 PM  bash: gunicorn: command not found
Mar 12 05:09:59 PM  ==> Starting service with 'gunicorn app:app'
Mar 12 05:09:59 PM  bash: gunicorn: command not found
Mar 12 05:10:29 PM  ==> Starting service with 'gunicorn app:app'
Mar 12 05:10:29 PM  bash: gunicorn: command not found
Mar 12 05:11:24 PM  ==> Starting service with 'gunicorn app:app'
Mar 12 05:11:24 PM  bash: gunicorn: command not found

do you have Gunicorn in your requirements.txt file?
bash: gunicorn: command not found suggests that the shell cannot find gunicorn to run

As mentioned, it is indeed in my requirements.txt

Below is the screenshot of it in my github repo:
image

Hi,

Your Build Command above doesn’t look right:

Mar 12 05:07:23 PM ==> Running build command 'find . -regex '.*requirements.txt$''

Maybe you want:

pip install -r requirements.txt

Alan

Hello Alan,

I’ve tried out that command before and resulted in failed build.

Mar 18 10:24:07 PM  ==> Checking out commit 0efd61cad81bad3c21d4b993dc71201df869fda8 in branch main
Mar 18 10:24:11 PM  ==> Using Python version: 3.7.10
Mar 18 10:24:14 PM  ==> Running build command 'pip install -r requirements.txt'...
Mar 18 10:24:15 PM  Collecting black==23.1.0
Mar 18 10:24:15 PM    Downloading black-23.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB)
Mar 18 10:24:15 PM  Collecting blinker==1.5
Mar 18 10:24:15 PM    Downloading blinker-1.5-py2.py3-none-any.whl (12 kB)
Mar 18 10:24:15 PM  Collecting certifi==2022.12.7
Mar 18 10:24:15 PM    Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
Mar 18 10:24:15 PM  Collecting cffi==1.15.1
Mar 18 10:24:15 PM    Downloading cffi-1.15.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (427 kB)
Mar 18 10:24:16 PM  Collecting charset-normalizer==3.0.1
Mar 18 10:24:16 PM    Downloading charset_normalizer-3.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (170 kB)
Mar 18 10:24:16 PM  Collecting click==8.1.3
Mar 18 10:24:16 PM    Downloading click-8.1.3-py3-none-any.whl (96 kB)
Mar 18 10:24:16 PM  Collecting colorama==0.4.6
Mar 18 10:24:16 PM    Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Mar 18 10:24:16 PM  ERROR: Could not find a version that satisfies the requirement contourpy==1.0.7 (from -r requirements.txt (line 8)) (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6)
Mar 18 10:24:16 PM  ERROR: No matching distribution found for contourpy==1.0.7 (from -r requirements.txt (line 8))
Mar 18 10:24:16 PM  WARNING: You are using pip version 20.1.1; however, version 23.0.1 is available.
Mar 18 10:24:16 PM  You should consider upgrading via the '/opt/render/project/src/.venv/bin/python -m pip install --upgrade pip' command.
Mar 18 10:24:17 PM  ==> Build failed 😞
Mar 18 10:24:17 PM  ==> Generating container image from build. This may take a few minutes...

You need to read those logs more closely:

ERROR: Could not find a version that satisfies the requirement contourpy==1.0.7

Looking at the “contourpy” package on Pypi, it requires Python >=3.8.

Back to the deploy logs above:

==> Using Python version: 3.7.10

Specify your Python version to match the one you developed on.

Alan

Apology for not seeing the simplest and the most obvious thing in front of me.
Successfully deployed, appreciate it much.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.