"Build failed 😞" message while trying to deploy app to Render

I have been trying to deploy an app to render but I keep getting the above message. I used pipreqs --encoding=utf8 to automatically generate the requirements files for the app which contains the following:

Pillow==9.3.0
Pillow==9.2.0
Pillow==10.0.0
Requests==2.31.0
streamlit==1.11.0
streamlit==1.25.0
streamlit_lottie==0.0.5

I went on to create a GitHub repository and uploaded the files for the app to the repository. I then connected the repository to render’s webservice option. the render’s build failed message is as follows:

Aug 12 06:49:53 PM  ==> Cloning from https://github.com/TyRonmi/brookfield-website...
Aug 12 06:49:54 PM  ==> Checking out commit 043a238d41e018f7eb6f168203d2dccd4bd9f9fc in branch master
Aug 12 06:49:58 PM  ==> Using Node version 14.17.0 (default)
Aug 12 06:49:58 PM  ==> Docs on specifying a Node version: https://render.com/docs/node-version
Aug 12 06:49:58 PM  ==> Using Python version 3.7.10 (default)
Aug 12 06:49:58 PM  ==> Docs on specifying a Python version: https://render.com/docs/python-version
Aug 12 06:50:02 PM  ==> Using Poetry version 1.1.14 (default)
Aug 12 06:50:02 PM  ==> Docs on specifying a Poetry version: https://render.com/docs/poetry-version
Aug 12 06:50:02 PM  ==> Running build command 'pip install -r requirements.txt'...
Aug 12 06:50:03 PM  ERROR: Double requirement given: Pillow==9.2.0 (from -r requirements.txt (line 2)) (already in Pillow==9.3.0 (from -r requirements.txt (line 1)), name='Pillow')
Aug 12 06:50:03 PM  WARNING: You are using pip version 20.1.1; however, version 23.2.1 is available.
Aug 12 06:50:03 PM  You should consider upgrading via the '/opt/render/project/src/.venv/bin/python -m pip install --upgrade pip' command.
Aug 12 06:50:03 PM  ==> Build failed 😞

Please how do I resolve this?

I tried to delete earlier versions of the duplicated modules in the requirements.txt file with no success

Aug 12 06:50:03 PM ERROR: Double requirement given: Pillow==9.2.0 (from -r requirements.txt (line 2)) (already in Pillow==9.3.0 (from -r requirements.txt (line 1)), name=‘Pillow’)

Remove all but one version of Pillow and streamlit.

1 Like

Thanks for your response, but I’ve tried deleting duplicate versions, but it’s still saying the build failed, so I reinstalled Anaconda and the necessary libraries for this project. In the end, my requirements.txt file is:

Pillow==9.5.0
Requests==2.31.0
streamlit==1.25.0
streamlit_lottie==0.0.5

This is the error message I’m getting now:

Aug 16 11:17:19 AM  ERROR: No matching distribution found for streamlit==1.25.0 (from -r requirements.txt (line 3))
Aug 16 11:17:19 AM  WARNING: You are using pip version 20.1.1; however, version 23.2.1 is available.
Aug 16 11:17:19 AM  You should consider upgrading via the '/opt/render/project/src/.venv/bin/python -m pip install --upgrade pip' command.
Aug 16 11:17:19 AM  ==> Build failed 😞

streamlit requires Python >= 3.8 ( see the sidebar of streamlit · PyPI ), Render defaults to the latest 3.7 version at this time, see Specifying a Python Version | Render

running python -V and pip -V suggests I’m using Python 3.9.13 and pip 23.2.1 respectively

That output is coming from your own computer, not on Render, because your output in the first post says:

Aug 12 06:49:58 PM ==> Using Python version 3.7.10 (default)

If you are using 3.9.13 locally, you should set that on Render as well. Specifying a Python Version | Render Docs

“You can customize the Python version for your app by setting the PYTHON_VERSION environment variable to a valid Python version”

How do I achieve this please? This is my first time using render

Hi there,

Please see our documentation for setting environment variables here: https://render.com/docs/configure-environment-variables

Regards,

Keith
Render Support, UTC+10 :australia:

Thanks for all your responses. I replaced streamlit==1.25.0 with streamlit<=1.25.0 in the requirements.txt file, and it was successful.

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